simulacrum
simulacrum copied to clipboard
Param mismatch is misreported as called-too-many-times
I haven't fully pinned it down yet, but there's some type of unexpected behavior, where:
- You have an expectation for a method to be called once with a parameter constraint
- That method is called with the wrong parameters
- There is then() after that method
- 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());