Skip to content

Commit

Permalink
(MODULES-905) Extend spec tests for bool2str
Browse files Browse the repository at this point in the history
The extended spec tests validate that the common types of values
that could be passed to bool2str() are rejected.
  • Loading branch information
mckern committed May 15, 2014
1 parent 93c4151 commit 557d38b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/unit/puppet/parser/functions/bool2str_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,16 @@
result = scope.function_bool2str([false])
result.class.should(eq(String))
end

it "should not accept a string" do
lambda { scope.function_bool2str(["false"]) }.should( raise_error(Puppet::ParseError))
end

it "should not accept a nil value" do
lambda { scope.function_bool2str([nil]) }.should( raise_error(Puppet::ParseError))
end

it "should not accept an undef" do
lambda { scope.function_bool2str([:undef]) }.should( raise_error(Puppet::ParseError))
end
end

0 comments on commit 557d38b

Please sign in to comment.