I'm using Spock and my class to test is wrapped in a Spy. I want to isolate the method being tested, so I'm trying to stub out other methods that are called from the method being tested. Normally I would use something like this:
1 * classToTest.methodName(_) >> stubbed_return_value
My problem is this: methodName
is a void method.
I tried this:
1 * classToTest.methodName(_)
but the actual method is still called.
How do I stub out a void method using Spock?