From: Ryan McKern Date: Thu, 15 May 2014 23:45:02 +0000 (-0700) Subject: (MODULES-905) Extend spec tests for bool2str X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=557d38bdc63b9b7d418f4bf0ce736406e71380b7;p=puppet-stdlib.git (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. --- diff --git a/spec/unit/puppet/parser/functions/bool2str_spec.rb b/spec/unit/puppet/parser/functions/bool2str_spec.rb index c73f7df..bed7e68 100755 --- a/spec/unit/puppet/parser/functions/bool2str_spec.rb +++ b/spec/unit/puppet/parser/functions/bool2str_spec.rb @@ -31,4 +31,16 @@ describe "the bool2str function" do 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