You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the spec is run, the library will use the first collaborator (i.e. service1) for both constructor parameters, so in the end, both instances in SomeClass will point to service1. I do not know if this is intended, but that is the result. In my opinion, the library should also take into account the field names when there are multiple collaborators of the same type.
Let's say you have the next piece of Java code:
and the next test specification:
When the spec is run, the library will use the first collaborator (i.e.
service1
) for both constructor parameters, so in the end, both instances inSomeClass
will point toservice1
. I do not know if this is intended, but that is the result. In my opinion, the library should also take into account the field names when there are multiple collaborators of the same type.I know there is a workaround, which is
but this workaround defies the purpose of this library and it also goes against Spock recommendations.
The text was updated successfully, but these errors were encountered: