From 7d19a8eae3fc911c0cee372b9a492ec203f4f45c Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 20 Mar 2023 23:42:40 +0100 Subject: feat: add support for multiple expectations of identical methods --- macros/src/expectation.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'macros/src/expectation.rs') 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) { -- cgit v1.2.3-18-g5258