You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree this would be quite useful, but there are some challenges to the implementation 😅
For the time being, my recommendation would be to always use the named method on your Mocks to make it easier to pinpoint what didn't work as expected!
Hello,
I think having clearer failed verification messages would make debugging multiple chained .and(matcher) calls easier. For example:
Mock::given(header_exists("X-Postmark-Server-Token"))
.and(header("Content-Type", "application/json"))
.and(path("/email"))
.and(method("POST"))
.and(SendEmailBodyMatcher)
Fails with:
thread 'email_client::tests::send_email_sends_the_expected_request' panicked at 'Verifications failed:
Expected range of matching incoming requests: == 1
Number of matched incoming requests: 0
As opposed to specifying which matcher in particular failed.
The text was updated successfully, but these errors were encountered: