Skip to content

Commit

Permalink
fix: Rename unmocked to applies_unmocked
Browse files Browse the repository at this point in the history
  • Loading branch information
audunhalland committed Mar 24, 2024
1 parent de3bef9 commit 558b428
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- 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](https://github.com/audunhalland/unimock/pull/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](https://github.com/audunhalland/unimock/pull/45))
### Fixed
Expand Down
4 changes: 2 additions & 2 deletions src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,14 +500,14 @@ let u = Unimock::new((
.returns(1),
FibMock::fib
.each_call(matching!(_))
.unmocked()
.applies_unmocked()
));
assert_eq!(55, u.fib(10));
```
",
)]
pub fn unmocked(mut self) -> Quantify<'p, F, O> {
pub fn applies_unmocked(mut self) -> Quantify<'p, F, O> {
self.wrapper.push_responder(DynResponder::Unmock);
self.quantify()
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ use private::{DefaultImplDelegator, Matching};
/// Unimock::new(
/// FactorialMock::factorial.stub(|each| {
/// each.call(matching!((input) if *input <= 1)).returns(1_u32); // unimock controls the API call
/// each.call(matching!(_)).unmocked();
/// each.call(matching!(_)).applies_unmocked();
/// })
/// )
/// .factorial(5)
Expand Down
8 changes: 4 additions & 4 deletions tests/it/unmock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ mod unmock_simple {
assert_eq!(
"ab",
Unimock::new(SpyableMock::concat.stub(|each| {
each.call(matching!("a", "b")).unmocked();
each.call(matching!("a", "b")).applies_unmocked();
}))
.concat("a".to_string(), "b".to_string())
);
Expand All @@ -75,7 +75,7 @@ mod unmock_simple {
each.call(matching!("", ""))
.returns("foobar")
.at_least_times(1);
each.call(matching!(_, _)).unmocked();
each.call(matching!(_, _)).applies_unmocked();
}))
.concat("a".to_string(), "b".to_string());
}
Expand All @@ -99,7 +99,7 @@ mod unmock_recursion {
120,
Unimock::new(FactorialMock::factorial.stub(|each| {
each.call(matching!(0 | 1)).returns(1u32);
each.call(matching!(_)).unmocked();
each.call(matching!(_)).applies_unmocked();
}))
.factorial(5)
);
Expand Down Expand Up @@ -139,7 +139,7 @@ mod unmock_async {
120,
Unimock::new(AsyncFactorialMock::factorial.stub(|each| {
each.call(matching!((input) if *input <= 1)).returns(1_u32);
each.call(matching!(_)).unmocked();
each.call(matching!(_)).applies_unmocked();
}))
.factorial(5)
.await,
Expand Down

0 comments on commit 558b428

Please sign in to comment.