Double
Full-featured mocking library in Rust, including rich failure messages and argument matchers.
Based off iredelmeier's initial mock implementation.
Double lets you mock Trait
implementations so that you can track function call arguments and set return values or overrides functions at test time.
Here's a quick example:
extern crate double;
// Code under test
// Tests which uses a mock BalanceSheet
mock_trait!;
// Executing tests
More examples are available in the examples directory.
Credits
This library is based off iredelmeier's initial mocking implementation. Massive thanks to her implementation for inpsiring me to work on this. The repo for her library can be found here.
If you're interested in testing, check out her other repositories too!