Details
Description
I've run across a situation where I'm getting "No more calls to 'MOCKED_METHOD' expected at this point..." exceptions in unit tests that shouldn't be dealing with any mocks. Attached is a bug-report that illustrates this, with comments in MyControllerTests.groovy as to how to get the tests w/no mocks to pass.
My app that began throwing these worked fine with a similar pattern of test methods up until 2.0-RC2.
$ grails test-app -unit
| Running 3 unit tests... 3 of 3
| Failure: testIndexWithoutUsingMockForAgain(mockfor.MyControllerTests)
| junit.framework.AssertionFailedError: No more calls to 'isMockForWorking' expected at this point. End of demands.
at grails.test.MockClosureProxy.doBeforeCall(MockClosureProxy.java:66)
at grails.test.AbstractClosureProxy.call(AbstractClosureProxy.java:74)
at mockfor.MyController.index(MyController.groovy:6)
at mockfor.MyControllerTests.testIndexWithoutUsingMockForAgain(MyControllerTests.groovy:32)
| Completed 3 unit tests, 1 failed in 2840ms
| Tests FAILED - view reports in target/test-reports
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits