Introduce test for array destruction

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.
This commit is contained in:
Spencer Krum 2013-11-19 20:11:08 -08:00 committed by Hunter Haugen
parent 85d5eadbab
commit a6ad0af08e

View file

@ -27,4 +27,9 @@ describe "the concat function" do
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