hakandilek / spock

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

Strict Expectations would be good #118

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Describe the new feature you have in mind.

Hi There, i appreciate the spock framework, i am using it, and it's look 
promising. before spock i have used jmock. which is pretty good as well. in 
spock frame work i am missing the strict expectation feature which is available 
in jmock. it would be nice if you have such a kind of feature in
spock, with the ability to turn on / turn off strict expectation. 

Which particular problem would this feature solve for you?

jMock automatically verifies any Verifiable objects stored in its instance 
variables. This helps the user avoid common errors caused by forgetting a 
verify statement. This automatic verification can be overridden if necessary. 
if spock also has this kind of of feature it would be great.. even jmockit also 
supporting these kind of features

Please provide any additional information below. You can also assign
labels.

Original issue reported on code.google.com by Mr.Amut...@gmail.com on 11 Aug 2010 at 4:52

GoogleCodeExporter commented 9 years ago
Here is how you do this with Spock:

when:
...
then:
... // the interactions that you expect
0 * _ // no other interactions

Or, if you also have interactions defined outside a then-block (say in setup:)

setup:
... // the interactions that you expect
0 * _ // no other interactions

when:
...
then:
... // additional interactions may go here

Original comment by pnied...@gmail.com on 11 Aug 2010 at 10:42

GoogleCodeExporter commented 9 years ago
Wow... Thank you.. It's working for me.. Great.. Spock is rocking..

Original comment by Mr.Amut...@gmail.com on 12 Aug 2010 at 4:47

GoogleCodeExporter commented 9 years ago
Thanks for the praise!

Original comment by pnied...@gmail.com on 12 Aug 2010 at 2:13