Skip to content

Commit

Permalink
Introduce test for array destruction
Browse files Browse the repository at this point in the history
It was discovered that the concat array modifies the arrays passed to it
as an argument as a side effect. This test will ensure that doesn't
happen again.
  • Loading branch information
nibalizer authored and hunner committed Jul 31, 2014
1 parent 85d5ead commit a6ad0af
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec/functions/concat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,9 @@
expect(result).to(eq(['1','2','3',['4','5'],'6']))
end

it "should leave the original array intact" do
array_original = ['1','2','3']
result = scope.function_concat([array_original,['4','5','6']])
array_original.should(eq(['1','2','3']))
end
end

0 comments on commit a6ad0af

Please sign in to comment.