alexliesenfeld / httpmock

HTTP mocking library for Rust
https://httpmock.rs
MIT License
488 stars 45 forks source link

Add delete_after_n method to When #108

Open wfchandler opened 4 months ago

wfchandler commented 4 months ago

In situations where a component is expected to automatically retry an endpoint, manually calling delete on a Mock may not be an option.

To support this scenario, add a new delete_after_n method to When that will remove the Mock from the server after it has matched the specified number of calls.

Related to https://github.com/alexliesenfeld/httpmock/issues/76 Related to https://github.com/alexliesenfeld/httpmock/issues/96

alexliesenfeld commented 4 months ago

Thank you for your PR @wfchandler! Looks like a useful addition. I will have a closer look at it or get back to you soon!