diff options
author | Adrien Thebo <git@somethingsinistral.net> | 2013-09-18 10:08:49 -0700 |
---|---|---|
committer | Adrien Thebo <git@somethingsinistral.net> | 2013-09-18 10:08:49 -0700 |
commit | 7ccf8cf09bb9dcdb59e1b2184a1f595dfa4a4340 (patch) | |
tree | f80b0677bd92aad3e268935b4b3e165c30323cb5 /spec/unit/puppet/parser/functions | |
parent | c2f584d2c2bb7f37a5dc83a9ef36a4a7db1170a6 (diff) | |
parent | 80a8b7bd1fdb3aadd53d112ce9a20b86d8ea9a62 (diff) | |
download | puppet-stdlib-7ccf8cf09bb9dcdb59e1b2184a1f595dfa4a4340.tar.gz puppet-stdlib-7ccf8cf09bb9dcdb59e1b2184a1f595dfa4a4340.tar.bz2 |
Merge pull request #184 from lmello/fix_bug_20681_delete_undef_values
delete_undef_values function fix bug #20681
Diffstat (limited to 'spec/unit/puppet/parser/functions')
-rw-r--r-- | spec/unit/puppet/parser/functions/delete_undef_values_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/unit/puppet/parser/functions/delete_undef_values_spec.rb b/spec/unit/puppet/parser/functions/delete_undef_values_spec.rb index 0536641..404aeda 100644 --- a/spec/unit/puppet/parser/functions/delete_undef_values_spec.rb +++ b/spec/unit/puppet/parser/functions/delete_undef_values_spec.rb @@ -26,4 +26,16 @@ describe "the delete_undef_values function" do result = scope.function_delete_undef_values([{'a'=>'A','b'=>:undef,'c'=>'C','d'=>'undef'}]) result.should(eq({'a'=>'A','c'=>'C','d'=>'undef'})) end + + it "should not change origin array passed as argument" do + origin_array = ['a',:undef,'c','undef'] + result = scope.function_delete_undef_values([origin_array]) + origin_array.should(eq(['a',:undef,'c','undef'])) + end + + it "should not change origin hash passed as argument" do + origin_hash = { 'a' => 1, 'b' => :undef, 'c' => 'undef' } + result = scope.function_delete_undef_values([origin_hash]) + origin_hash.should(eq({ 'a' => 1, 'b' => :undef, 'c' => 'undef' })) + end end |