Skip to content

Commit b975bd6

Browse files
committed
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
1 parent f496005 commit b975bd6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

spec/unit/puppet/parser/functions/merge_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
describe 'when calling merge on the scope instance' do
2727
it 'should require all parameters are hashes' do
2828
expect { new_hash = scope.function_merge([{}, '2'])}.to raise_error(Puppet::ParseError, /unexpected argument type String/)
29+
expect { new_hash = scope.function_merge([{}, 2])}.to raise_error(Puppet::ParseError, /unexpected argument type Fixnum/)
30+
end
31+
32+
it 'should accept empty strings as puppet undef' do
33+
expect { new_hash = scope.function_merge([{}, ''])}.not_to raise_error(Puppet::ParseError, /unexpected argument type String/)
2934
end
3035

3136
it 'should be able to merge two hashes' do

0 commit comments

Comments
 (0)