From ad2a6d1dc517407939ed022bba9f3352efc678ce Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 19 Mar 2023 16:29:23 +0100 Subject: feat: add call count expectations to expectations --- macros/src/mock.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'macros/src/mock.rs') diff --git a/macros/src/mock.rs b/macros/src/mock.rs index 8828b17..d2eb451 100644 --- a/macros/src/mock.rs +++ b/macros/src/mock.rs @@ -247,15 +247,7 @@ fn create_mock_function( )) .with_generic_params::<#(#type_param_idents,)*>(); - let Some(returning) = &expectation.returning else { - panic!(concat!( - "Expectation for function", - stringify!(#func_ident), - " is missing a function to call") - ); - }; - - returning(#(#args),*) + expectation.call_returning(#(#args),*) } }) .unwrap_or_abort(), -- cgit v1.2.3-18-g5258