Open sjud opened 3 years ago
This would be very useful!
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 Mock
s 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:
As opposed to specifying which matcher in particular failed.