lipanski / mockito

HTTP mocking for Rust!
MIT License
695 stars 59 forks source link

Add a matched() -> bool method to mock #125

Closed max-b closed 4 years ago

max-b commented 4 years ago

Hi!

Thanks so much for this library - I really appreciate the work you've put into it! I have a slightly unusual use case surrounding testing async processing and I'd basically like to check to see if the mock has matched while not panicking. It looks like mockito::mock isn't UnwindSafe so catching the assert panic requires wrapping it in a AssertUnwindSafe which I'm not totally sure is correct.

This just provides a matched method that returns a bool for this particular use case. Let me know what you think/if it's appropriate or not!

Thanks!!!

lipanski commented 4 years ago

@max-b looks good, thanks for your contribution (and special :1st_place_medal: for updating the docs). I think this can fit into the library so I'm going to merge.

lipanski commented 4 years ago

Released in 0.27.0 :rocket:

max-b commented 4 years ago

:tada: thanks!!