Skip to content

Releases: pcsm/simulacrum

Simulacrum 0.3.1

29 Mar 20:47

Choose a tag to compare

  • Made mock objects created with macros no longer warn about dead code (#43)

Simulacrum 0.3.0

28 Mar 02:01

Choose a tag to compare

  • Reorganized the crate structure to make it easier to update parts of the project without breaking more than is necessary. simulacrum is now a facade crate (#41)
  • Improved importing (#16)
  • Improved macro hygiene (#39, #40)
  • Minor documentation bug fixes (#7, #37)

Macros v0.2.1

23 Mar 17:44

Choose a tag to compare

  • Remove warning about unused params when was_called! is used (#35)

Macros v0.2.0

09 Jan 01:26

Choose a tag to compare

  • Updated Macros to use Core v0.2.0

Core v0.2.0

09 Jan 01:03

Choose a tag to compare

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

02 Jan 23:52

Choose a tag to compare

  • Improved error messages with mismatched parameters.

Macros v0.1.1

22 Dec 02:11

Choose a tag to compare

  • create_mock! now handles unsafe fns properly

Initial Macros Release

22 Dec 02:05

Choose a tag to compare

macros-v0.1.0

No longer using path dependencies

Initial Core Release

22 Dec 02:04

Choose a tag to compare

core-v0.1.0

No longer using path dependencies