summaryrefslogtreecommitdiff
path: root/spec/unit/puppet/parser/functions/delete_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/puppet/parser/functions/delete_spec.rb')
-rwxr-xr-xspec/unit/puppet/parser/functions/delete_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/unit/puppet/parser/functions/delete_spec.rb b/spec/unit/puppet/parser/functions/delete_spec.rb
index 2f29c93..06238f1 100755
--- a/spec/unit/puppet/parser/functions/delete_spec.rb
+++ b/spec/unit/puppet/parser/functions/delete_spec.rb
@@ -35,4 +35,22 @@ describe "the delete function" do
result.should(eq({ 'a' => 1, 'c' => 3 }))
end
+ it "should not change origin array passed as argument" do
+ origin_array = ['a','b','c','d']
+ result = scope.function_delete([origin_array, 'b'])
+ origin_array.should(eq(['a','b','c','d']))
+ end
+
+ it "should not change the origin string passed as argument" do
+ origin_string = 'foobarbabarz'
+ result = scope.function_delete([origin_string,'bar'])
+ origin_string.should(eq('foobarbabarz'))
+ end
+
+ it "should not change origin hash passed as argument" do
+ origin_hash = { 'a' => 1, 'b' => 2, 'c' => 3 }
+ result = scope.function_delete([origin_hash, 'b'])
+ origin_hash.should(eq({ 'a' => 1, 'b' => 2, 'c' => 3 }))
+ end
+
end