summaryrefslogtreecommitdiff
path: root/spec/unit/puppet
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/puppet')
-rw-r--r--spec/unit/puppet/parser/functions/num2bool_spec.rb36
1 files changed, 10 insertions, 26 deletions
diff --git a/spec/unit/puppet/parser/functions/num2bool_spec.rb b/spec/unit/puppet/parser/functions/num2bool_spec.rb
index 038881f..b56196d 100644
--- a/spec/unit/puppet/parser/functions/num2bool_spec.rb
+++ b/spec/unit/puppet/parser/functions/num2bool_spec.rb
@@ -25,18 +25,13 @@ describe "the num2bool function" do
result.should(be_true)
end
- it "should return true if passed number 1" do
- result = scope.function_num2bool([1])
- result.should(be_true)
- end
-
- it "should return true if passed array with string 1" do
- result = scope.function_num2bool([["1"]])
+ it "should return true if passed string 1.5" do
+ result = scope.function_num2bool(["1.5"])
result.should(be_true)
end
- it "should return true if passed array with number 1" do
- result = scope.function_num2bool([[1]])
+ it "should return true if passed number 1" do
+ result = scope.function_num2bool([1])
result.should(be_true)
end
@@ -50,34 +45,23 @@ describe "the num2bool function" do
result.should(be_false)
end
- it "should return false if passed array with string 0" do
- result = scope.function_num2bool([["0"]])
- result.should(be_false)
- end
-
- it "should return false if passed array with number 0" do
- result = scope.function_num2bool([[0]])
- result.should(be_false)
- end
-
it "should return false if passed string -1" do
result = scope.function_num2bool(["-1"])
result.should(be_false)
end
- it "should return false if passed number -1" do
- result = scope.function_num2bool([-1])
+ it "should return false if passed string -1.5" do
+ result = scope.function_num2bool(["-1.5"])
result.should(be_false)
end
- it "should return false if passed array with string -1" do
- result = scope.function_num2bool([["-1"]])
+ it "should return false if passed number -1" do
+ result = scope.function_num2bool([-1])
result.should(be_false)
end
- it "should return false if passed array with number -1" do
- result = scope.function_num2bool([[-1]])
+ it "should return false if passed float -1.5" do
+ result = scope.function_num2bool([-1.5])
result.should(be_false)
end
-
end