Replies: 1 comment 2 replies
-
static functions' expectations are global, because there's no mock object to own them. With non-static functions, the expectation state is owned by the mock object. But static functions don't have any associated mock object. So you need to synchronize your tests with some kind of Mutex. Here's an example of how to do that: https://github.com/asomers/mockall/blob/master/mockall/examples/synchronization.rs . |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Over here I did a test and saw that the tests fail because of the shared expectations.
Is this a design choice, or a technical limitation? If it's the latter, can we find a way to solve it?
Beta Was this translation helpful? Give feedback.
All reactions