Releases: pcsm/simulacrum
Releases · pcsm/simulacrum
Simulacrum 0.3.1
- Made mock objects created with macros no longer warn about dead code (#43)
Simulacrum 0.3.0
Macros v0.2.1
- Remove warning about unused params when
was_called!is used (#35)
Macros v0.2.0
- Updated Macros to use Core v0.2.0
Core v0.2.0
Modification Behaviors
Now you can mutate &mut parameters in methods by adding a Modification behavior. Previously this had to be done in the Return behavior. For example, you can now specify a Modification and a Return behavior:
mock_object.expect_demo_method()
.called_once()
.with(5)
.modifying(|&mut arg| {
unsafe {
*arg = GENERATED_ID;
}
})
.returning(|_| 15);Some notes:
- Specifying a modification behavior is optional, and will only be run if it is specified.
- If a method has a return type, specifying a return behavior is not optional, just like today.
Other
- Now only one expectation can be added per era per method.
- Minor bugfix (#12)
Core v0.1.2
- Improved error messages with mismatched parameters.
Macros v0.1.1
create_mock!now handlesunsafe fns properly
Initial Macros Release
macros-v0.1.0 No longer using path dependencies
Initial Core Release
core-v0.1.0 No longer using path dependencies