Releases: audunhalland/unimock
Releases · audunhalland/unimock
0.6.7
0.6.6
Fixed
- Silenced
clippy::multiple_bound_locations
lints - Small doc improvements
0.6.5
Added
- Support for mocking embedded-hal (#55).
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
0.6.3
0.6.2
Fixed
- Don't trigger
manual_async_fn
lint when mocking-> impl Future
methods.
0.6.1
Fixed
- Unmocking using
async fn
when the trait fn has an-> impl Future
signature.
0.6.0
Changed
- Unimock now supports very flexible argument mutation, instead of one hard-coded parameter.
To achieve this, theanswers
API had to be redesigned with a new signature based on adyn Fn
.
This dynamic function type has one fixed signature perMockFn
, so its return type isn't generic as it used to be in0.5.x
.
All generated borrows have to be done explicitly throughUnimock::make_ref
for this to work. (#43, #47)- The function passed to
answers
must be a&static
Fn, or it can be anArc
closure that can be registered by callinganswers_arc
. - The parameters passed to this function are the same as passed to the mocked trait method, including
self
.
- The function passed to
- Output trait hierarchy (which allows safely mocking borrowed return values) rewritten to be more flexible and future-proof than previously (#46)
default_implementation
renamed toapplies_default_impl
.unmocked
renamed toapplies_unmocked
.
Added
- Mocks for
tokio-1
andfutures-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 usinganswers
.