summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
authorRyan McKern <ryan.mckern@puppetlabs.com>2014-05-15 16:45:02 -0700
committerRyan McKern <ryan.mckern@puppetlabs.com>2014-05-15 16:45:02 -0700
commit557d38bdc63b9b7d418f4bf0ce736406e71380b7 (patch)
treeb94d1f583b0d7416e8f6eb9f6fe2c4374e406572 /spec/unit
parent93c4151edfedb28a0cafa60011c57eb6d76ca6be (diff)
(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.
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/puppet/parser/functions/bool2str_spec.rb12
1 files changed, 12 insertions, 0 deletions
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