summaryrefslogtreecommitdiff
path: root/spec/unit/puppet
diff options
context:
space:
mode:
authorstephen <stephen@puppetlabs.com>2013-01-03 13:53:03 +0000
committerJeff McCune <jeff@puppetlabs.com>2013-01-03 13:37:55 -0800
commit190b9438c58eab2322bdf216be1aaae109d14072 (patch)
treeabbec3c0a8732b520d79c5d852d395312937f2c9 /spec/unit/puppet
parente1f2a932883c71038d78938efd46cdb30c01da6d (diff)
downloadpuppet-stdlib-190b9438c58eab2322bdf216be1aaae109d14072.tar.gz
puppet-stdlib-190b9438c58eab2322bdf216be1aaae109d14072.tar.bz2
Add test/validation for is_numeric if created from an arithmetical operation
Diffstat (limited to 'spec/unit/puppet')
-rw-r--r--spec/unit/puppet/parser/functions/is_numeric_spec.rb10
1 files changed, 10 insertions, 0 deletions
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))