Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Global Groovy mock doesn't work as expected #785
Hello, I made a unit test example based on the documentation here:
Specifically, I am following the example under the section: Mocking All Instances of a Type
Here is my code:
After running these 2 tests, the first one passes. However the second one failed with below error:
I would expect the second test passes as well, did I miss something in the test? Please help!
Here is my local env: (and I am using latest spock: spock-core:1.1-groovy-2.4-rc-3)
Build time: 2017-09-20 14:48:23 UTC
I also find a weird situation when I try to use global GroovySpy. I copied the unit test example here:
The above test case failed which gives me this error:
The only thing I changed is the order of mock and actual creation of the instance. Can someone explain why this test case fails?