-
Notifications
You must be signed in to change notification settings - Fork 76
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
[proposal] Add a specialized function to refute a call #145
Comments
rbino
changed the title
[proposal] A specialized function to _refute_ a call
[proposal] A specialized function to refute a call
Nov 3, 2023
rbino
changed the title
[proposal] A specialized function to refute a call
[proposal] Add a specialized function to refute a call
Nov 3, 2023
I think adding a |
rbino
added a commit
to rbino/mox
that referenced
this issue
Nov 3, 2023
Allow rejecting a call to a mock with clearer intentions. Closes dashbitco#145.
Merged
rbino
added a commit
to rbino/mox
that referenced
this issue
Nov 4, 2023
Allow denying a call to a mock with clearer intentions. Closes dashbitco#145.
josevalim
pushed a commit
that referenced
this issue
Nov 4, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey everyone!
I've been using Mox a lot and one thing that bothers me a little is that when I define an expectation that I expect to be called 0 times (i.e. I refute it), it's not very evident since the only "different" thing is the
0
passed as argument, which sometimes gets lost in the surrounding noise.My proposal is the introduction of a
refute
(or some other name, naming things is hard etc etc) function which makes the intention more evident when reading the test. I would also allow to pass the arity as an integer instead of passing a lambda (possibly allowing both), since I find that having to define afun
for something I expect not to be called is what generates most of the noise.So the interface would look something like that
If this sounds interesting I'd be happy to take a stab at it.
The text was updated successfully, but these errors were encountered: