-
-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slightly confusing expectation behaviour when stubbing after expectation #171
Comments
This aspect of Mocha was modelled on the method dispatch behaviour of jMock v1 [1]. I thought I had written it up somewhere in the documentation, but I can't find it. The best I can do is point you at this acceptance test which describes the current behaviour. It's worth noting that in some cases, it may be possible to use Mocha's states functionality to achieve what you want. In the long term I'd like to change this aspect of Mocha's behaviour to be more like that of jMock v2 [2], but this would require a major version release and I just haven't managed to find the time to do it. [1] http://www.jmock.org/jmock1-dispatch.html |
Ah, that's really interesting. I wonder if there's a sensible place in the documentation or the README to start collecting gotchas like this? — James On Fri, Dec 13, 2013 at 6:14 AM, James Mead [email protected]
|
@lazyatom I've added documentation for this in my fix for #172. See these two links:
I hope that helps. |
It looks like calling
stubs
causes a previousexpects
to fail. Running the following (somewhat contrived) example will fail:Here's the slightly confusing message you get:
I can imagine why this might be the case, but I wondered if it was a gotcha that was documented anywhere?
The text was updated successfully, but these errors were encountered: