Skip to content
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

Param mismatch is misreported as called-too-many-times #46

Open
jasongrlicky opened this issue Mar 30, 2018 · 0 comments
Open

Param mismatch is misreported as called-too-many-times #46

jasongrlicky opened this issue Mar 30, 2018 · 0 comments

Comments

@jasongrlicky
Copy link
Contributor

I haven't fully pinned it down yet, but there's some type of unexpected behavior, where:

  1. You have an expectation for a method to be called once with a parameter constraint
  2. That method is called with the wrong parameters
  3. There is then() after that method
  4. After the then(), there is another expectation for that same method to be called once

If all of that happens, then the problem will be reported as the method being called one too many times instead of a param mismatch.


Originally observed in code like the following:

let mut g = Mock::new();
g.expect_method_1().called_once().with(any());
g.expect_method_2().called_once().with(none());
g.then();
g..expect_method1().called_once().with(any());
g.expect_method_2().called_once().with(any());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant