simulacrum
simulacrum copied to clipboard
A small library for creating mock objects in Rust.
See https://github.com/glium/glium/issues/1402 for benefits and details.
Using the low-level technique, I can create mocks for structs with methods that have generic parameters. In different testcases, I can create expectations with different type arguments. However, I cannot...
`simulacrum_mock::method::TrackedMethod::returning` takes an `FnMut` closure, from which captured variables cannot be moved. Captured variables can only be moved out of `FnOnce` closures. This is a problem, because it makes it...
If an expectation has `.called_once` yet gets called more than once, it doesn't currently fail until the end of the test. This can be very confusing, especially if the following...
I can use Simulacrum to mock a method with generic parameters, and to mock a method with a generic return value, but I seemingly can't do both at the same...
This seems to be a more widely accepted terminology for this concept. Should be updated in the struct names and the docs!
Right now it doesn't tell you how to get started - it should!
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...