summaryrefslogtreecommitdiff
path: root/spec/unit/puppet/parser
diff options
context:
space:
mode:
authorJeff McCune <jeff@puppetlabs.com>2013-01-03 13:39:42 -0800
committerJeff McCune <jeff@puppetlabs.com>2013-01-03 13:39:42 -0800
commit388cfa547de3021c0e82e3bbe60904f1e71d5f29 (patch)
tree4a4a6109a81be7f461594f037c9e42d4f1a06928 /spec/unit/puppet/parser
parent2df66c041109ecca1099bf3977657572cc32ad24 (diff)
parentfb7ae217438590c8ca081d9646f2823d03bbb83d (diff)
Merge branch '4.x'
* 4.x: Add test/validation for is_float if created from an arithmetical operation Add test/validation for is_integer if created from an arithmetical operation Add test/validation for is_numeric if created from an arithmetical operation
Diffstat (limited to 'spec/unit/puppet/parser')
-rw-r--r--spec/unit/puppet/parser/functions/is_float_spec.rb4
-rw-r--r--spec/unit/puppet/parser/functions/is_integer_spec.rb5
-rw-r--r--spec/unit/puppet/parser/functions/is_numeric_spec.rb10
3 files changed, 19 insertions, 0 deletions
diff --git a/spec/unit/puppet/parser/functions/is_float_spec.rb b/spec/unit/puppet/parser/functions/is_float_spec.rb
index 2f527d9..b7d73b0 100644
--- a/spec/unit/puppet/parser/functions/is_float_spec.rb
+++ b/spec/unit/puppet/parser/functions/is_float_spec.rb
@@ -26,4 +26,8 @@ describe "the is_float function" do
result = scope.function_is_float(["3"])
result.should(eq(false))
end
+ it "should return true if a float is created from an arithmetical operation" do
+ result = scope.function_is_float([3.2*2])
+ result.should(eq(true))
+ end
end
diff --git a/spec/unit/puppet/parser/functions/is_integer_spec.rb b/spec/unit/puppet/parser/functions/is_integer_spec.rb
index 5afbba4..4335795 100644
--- a/spec/unit/puppet/parser/functions/is_integer_spec.rb
+++ b/spec/unit/puppet/parser/functions/is_integer_spec.rb
@@ -26,4 +26,9 @@ describe "the is_integer function" do
result = scope.function_is_integer(["asdf"])
result.should(eq(false))
end
+
+ it "should return true if an integer is created from an arithmetical operation" do
+ result = scope.function_is_integer([3*2])
+ result.should(eq(true))
+ end
end
diff --git a/spec/unit/puppet/parser/functions/is_numeric_spec.rb b/spec/unit/puppet/parser/functions/is_numeric_spec.rb
index 4078b37..d7440fb 100644
--- a/spec/unit/puppet/parser/functions/is_numeric_spec.rb
+++ b/spec/unit/puppet/parser/functions/is_numeric_spec.rb
@@ -22,6 +22,16 @@ describe "the is_numeric function" do
result.should(eq(true))
end
+ it "should return true if an integer is created from an arithmetical operation" do
+ result = scope.function_is_numeric([3*2])
+ result.should(eq(true))
+ end
+
+ it "should return true if a float is created from an arithmetical operation" do
+ result = scope.function_is_numeric([3.2*2])
+ result.should(eq(true))
+ end
+
it "should return false if a string" do
result = scope.function_is_numeric(["asdf"])
result.should(eq(false))