summaryrefslogtreecommitdiff
path: root/macros/src/expectation.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2023-03-20 23:42:40 +0100
committerHampusM <hampus@hampusmat.com>2023-03-20 23:42:40 +0100
commit7d19a8eae3fc911c0cee372b9a492ec203f4f45c (patch)
treed9b0fb703dc5b06d686fcf2815b1792ea75a24e9 /macros/src/expectation.rs
parent888fd0336e64ccb68f5675b9fc8c56f21f5a418e (diff)
feat: add support for multiple expectations of identical methods
Diffstat (limited to 'macros/src/expectation.rs')
-rw-r--r--macros/src/expectation.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/macros/src/expectation.rs b/macros/src/expectation.rs
index a6d181f..4095278 100644
--- a/macros/src/expectation.rs
+++ b/macros/src/expectation.rs
@@ -402,6 +402,22 @@ impl ToTokens for Expectation
}
}
+ impl #boundless_impl_generics #ident #ty_generics {
+ fn is_exhausted(&self) -> bool {
+ if let ::ridicule::__private::CallCountExpectation::Times(times) =
+ self.call_cnt_expectation
+ {
+ if times == self.call_cnt.load(
+ ::std::sync::atomic::Ordering::Relaxed
+ ) {
+ return true;
+ }
+ }
+
+ false
+ }
+ }
+
impl #boundless_impl_generics Drop for #ident #ty_generics
{
fn drop(&mut self) {