sampig / spock

Automatically exported from code.google.com/p/spock
0 stars 0 forks source link

It's not possible to verify "set property" on mocks #258

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Compile and run the attached files.

I sent a question on the mailing list regarding this and got the following 
answer from Peter:

The first syntax is correct. The only case where it doesn't work is when 
ToBeMocked is a class rather than an interface and the caller uses property 
rather than setter syntax. In that case, there apparently is some strange 
interaction between Groovy and the mock subclass created by Spock. I've seen 
something similar before, but haven't been able to figure out what the problem 
is. I'll give it another try for 0.7.

I'm using 
org.spockframework:spock-core:0.6-groovy-1.8
org.codehaus.groovy:groovy-all:1.8.6

-Steinar

Original issue reported on code.google.com by steinar....@gmail.com on 21 Jun 2012 at 10:50

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed in the latest snapshot.

Original comment by pnied...@gmail.com on 22 Jun 2012 at 3:19