From 37ac847b54eedb32a32d2a7d39e3987965fadb4d Mon Sep 17 00:00:00 2001 From: Cristiano Piemontese Date: Mon, 25 Nov 2024 15:42:33 +0100 Subject: [PATCH] still messed up --- src/tests/mocks/mod.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/tests/mocks/mod.rs b/src/tests/mocks/mod.rs index fe479f0..cc4a6c8 100644 --- a/src/tests/mocks/mod.rs +++ b/src/tests/mocks/mod.rs @@ -250,12 +250,14 @@ pub fn event_with_options_mock( client_mock .expect_event_with_options() .once() - .withf(move |called_metric, called_text, called_tags, called_options| { - called_metric == metric - && called_text == text - && called_tags.iter().all(|tag| tags.contains(&tag.as_str())) - && matches!((called_options, options), (Some(_), Some(_)) | (None, None)) - }) + .with( + eq(metric), + eq(text), + function(move |called_tags: &Vec| called_tags.iter().all(|tag| tags.contains(&tag.as_str()))), + function(move |called_options: &Option>| { + matches!((called_options, options), (Some(_), Some(_)) | (None, None)) + }), + ) .return_const(()); client_mock