From 1abf4b62fc8e97c7096c9da3d350e3e6268c5c72 Mon Sep 17 00:00:00 2001 From: Ken Barber Date: Thu, 30 Jun 2011 01:00:32 +0200 Subject: Few more tests. --- spec/unit/parser/functions/bool2num_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'spec/unit/parser/functions/bool2num_spec.rb') diff --git a/spec/unit/parser/functions/bool2num_spec.rb b/spec/unit/parser/functions/bool2num_spec.rb index a2585e9..d5da18c 100755 --- a/spec/unit/parser/functions/bool2num_spec.rb +++ b/spec/unit/parser/functions/bool2num_spec.rb @@ -18,4 +18,14 @@ describe "the bool2num function" do lambda { @scope.function_bool2num([]) }.should( raise_error(Puppet::ParseError)) end + it "should convert true to 1" do + result = @scope.function_bool2num([true]) + result.should(eq(1)) + end + + it "should convert false to 0" do + result = @scope.function_bool2num([false]) + result.should(eq(0)) + end + end -- cgit v1.2.3