Skip to content

Commit 557d38b

Browse files
committed
(MODULES-905) Extend spec tests for bool2str
The extended spec tests validate that the common types of values that could be passed to bool2str() are rejected.
1 parent 93c4151 commit 557d38b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

spec/unit/puppet/parser/functions/bool2str_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,16 @@
3131
result = scope.function_bool2str([false])
3232
result.class.should(eq(String))
3333
end
34+
35+
it "should not accept a string" do
36+
lambda { scope.function_bool2str(["false"]) }.should( raise_error(Puppet::ParseError))
37+
end
38+
39+
it "should not accept a nil value" do
40+
lambda { scope.function_bool2str([nil]) }.should( raise_error(Puppet::ParseError))
41+
end
42+
43+
it "should not accept an undef" do
44+
lambda { scope.function_bool2str([:undef]) }.should( raise_error(Puppet::ParseError))
45+
end
3446
end

0 commit comments

Comments
 (0)