Why does the following test not pass? I must be missing something fundamental about how copy works. It seems to have a reference to the json object and not a copy.
Feature: testing
@one
Scenario: one
* def root = { name: 'inner' }
Scenario: two
* def a = call read('testing.feature@one')
* copy b = a
* set b.root.name = "copy"
* match b.root.name == "copy"
* match a.root.name == "called"
Always un-wrap the results of
call
. The reason is that particular JSON object is "special" (a Java map) which does not follow the rules ofcopy
- because you can have references to other Java objects. So this will work: