Skip to content

Releases: audunhalland/unimock

0.6.7

27 Jul 15:34
Compare
Choose a tag to compare

Fixed

  • Leaked private type for generic-argument mocks in with_types signature (#58).

0.6.6

08 May 01:51
Compare
Choose a tag to compare

Fixed

  • Silenced clippy::multiple_bound_locations lints
  • Small doc improvements

0.6.5

08 Apr 02:19
Compare
Choose a tag to compare

Added

Fixed

  • Compile error encountered &[NoDebug] arguments.
  • Default methods when the trait needs generic arguments.
  • Missing documentation warning for the generated with_types function.

0.6.4

01 Apr 16:03
Compare
Choose a tag to compare

Added

  • Support for returning references to non-Send types (#53)

0.6.3

28 Mar 00:20
Compare
Choose a tag to compare

Added

  • Basic support for mutable outputs (#49)

0.6.2

27 Mar 03:13
Compare
Choose a tag to compare

Fixed

  • Don't trigger manual_async_fn lint when mocking -> impl Future methods.

0.6.1

27 Mar 00:44
Compare
Choose a tag to compare

Fixed

  • Unmocking using async fn when the trait fn has an -> impl Future signature.

0.6.0

25 Mar 00:31
Compare
Choose a tag to compare

Changed

  • Unimock now supports very flexible argument mutation, instead of one hard-coded parameter.
    To achieve this, the answers API had to be redesigned with a new signature based on a dyn Fn.
    This dynamic function type has one fixed signature per MockFn, so its return type isn't generic as it used to be in 0.5.x.
    All generated borrows have to be done explicitly through Unimock::make_ref for this to work. (#43, #47)
    • The function passed to answers must be a &static Fn, or it can be an Arc closure that can be registered by calling answers_arc.
    • The parameters passed to this function are the same as passed to the mocked trait method, including self.
  • Output trait hierarchy (which allows safely mocking borrowed return values) rewritten to be more flexible and future-proof than previously (#46)
  • default_implementation renamed to applies_default_impl.
  • unmocked renamed to applies_unmocked.

Added

  • Mocks for tokio-1 and futures-io-0-3 async read/write traits (#45)

Fixed

  • Fix matching! against references to number literals (#42)
  • Borrows from function arguments can now be made without leaking memory (#47)

Removed

  • The mutates builder APIs. These are now handled using answers.