summaryrefslogtreecommitdiff
path: root/spec/unit/puppet/parser
diff options
context:
space:
mode:
authorMartin Hellmich <mhellmic@gmail.com>2013-05-08 18:20:56 +0200
committerMartin Hellmich <mhellmic@gmail.com>2013-05-08 18:24:46 +0200
commitb975bd66aa7345a5eeb54eb79dd0f708934609f8 (patch)
treed5c14e7bf08189a412dcabdb23d01a231586f334 /spec/unit/puppet/parser
parentf496005bf3db8a5202bf9c16daf9a524b178c67a (diff)
downloadpuppet-stdlib-b975bd66aa7345a5eeb54eb79dd0f708934609f8.tar.gz
puppet-stdlib-b975bd66aa7345a5eeb54eb79dd0f708934609f8.tar.bz2
Added rspec tests for the new behaviour of merge accepting empty strings
added test that '' is accepted changed a test that a number is correctly rejected with a type error
Diffstat (limited to 'spec/unit/puppet/parser')
-rw-r--r--spec/unit/puppet/parser/functions/merge_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/unit/puppet/parser/functions/merge_spec.rb b/spec/unit/puppet/parser/functions/merge_spec.rb
index 04169e7..8a170bb 100644
--- a/spec/unit/puppet/parser/functions/merge_spec.rb
+++ b/spec/unit/puppet/parser/functions/merge_spec.rb
@@ -26,6 +26,11 @@ describe Puppet::Parser::Functions.function(:merge) do
describe 'when calling merge on the scope instance' do
it 'should require all parameters are hashes' do
expect { new_hash = scope.function_merge([{}, '2'])}.to raise_error(Puppet::ParseError, /unexpected argument type String/)
+ expect { new_hash = scope.function_merge([{}, 2])}.to raise_error(Puppet::ParseError, /unexpected argument type Fixnum/)
+ end
+
+ it 'should accept empty strings as puppet undef' do
+ expect { new_hash = scope.function_merge([{}, ''])}.not_to raise_error(Puppet::ParseError, /unexpected argument type String/)
end
it 'should be able to merge two hashes' do