mox icon indicating copy to clipboard operation
mox copied to clipboard

Calling `verify!` should raise a `Mox.VerificationError` if there are too many calls to a mock

Open metavida opened this issue 1 year ago • 5 comments

Similar to comments in Issue #32, there are certain cases when we want to assert that a mocked function is never called (or is not over-called) but where the expected calls happen within code that either async or has aggressive error handling. In these cases it's desirable for verify! (and verify_on_exit!) to inform the user when an expectation has been violated by receiving too many calls.

Currently this PR does not implement a solution but does contribute 4 net-new verify! unit tests that should begin passing once this behavior is implemented.

Does this seem like a reasonable request/approach?

metavida avatar Aug 04 '23 19:08 metavida