sreedharkesarla / spock

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

Extend Interaction API to support constructed objects #254

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Extend the Interaction API so that objects that are constructed in scope can be 
mocked. 

e.g. 
def mock = Mock(MyClass, [arg1, arg2])
1 * mock.a(_)
etc.

I find myself flipping to GMock 
(https://code.google.com/p/gmock/wiki/Documentation_0_8?tm=6) to handle objects 
constructed in scope and wrapping blocks in play {}. It would be really great 
if the Spock interaction API could handle this instead for consistency and ease 
of use.

Original issue reported on code.google.com by gus.j.po...@gmail.com on 3 Jun 2012 at 11:25

GoogleCodeExporter commented 8 years ago
Try the new `GroovySpy(Foo, global: true)`.

Original comment by pnied...@gmail.com on 22 Jul 2012 at 5:28

GoogleCodeExporter commented 8 years ago
Excellent - I will!

Original comment by gus.j.po...@gmail.com on 22 Jul 2012 at 8:16