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:
parent
85d5eadbab
commit
a6ad0af08e
1 changed files with 5 additions and 0 deletions
|
@ -27,4 +27,9 @@ describe "the concat function" do
|
||||||
expect(result).to(eq(['1','2','3',['4','5'],'6']))
|
expect(result).to(eq(['1','2','3',['4','5'],'6']))
|
||||||
end
|
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
|
end
|
||||||
|
|
Loading…
Reference in a new issue