Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add support for expecting a method to *not* be called. #7

merged 1 commit into from Jul 3, 2011


None yet
2 participants

jcohen commented Jun 3, 2011

This used to work, but it seems to have stopped at some point. What seems to be the problem is gently is treating the existence of an expectation as proof of a failure, but what we really care about is the existence of an expectation whose count is > 0. For example if I were to do:

gently.expect(someObject, "someFunction", 0);

To be sure that someObject.someFunction is never called, in the event that everything is working as intended and someObject.someFunction is not invoked, the expectation would still exist, and thus verify call would fail. After this patch, verify will only fail if expectations with a count > 0 still exist.

This time including a test case which I should've done to begin with, sorry about that ;).

jcohen commented Jun 14, 2011

Felix, Any chance of pulling this in?

felixge added a commit that referenced this pull request Jul 3, 2011

Merge pull request #7 from jcohen/master
Add support for expecting a method to *not* be called.

@felixge felixge merged commit 85cb0ba into felixge:master Jul 3, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment