New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reset webmock after all after(:each/example) hooks #865
Conversation
@drews256 thank you for pointing that. I agree |
Definitely agreed. Any thoughts on some more specs to see if we can make it break. The cool thing about Could we toggle this as some sort of setting and deprecate the old way? Or maybe just leave it as some sort of setting? I feel like at the minimum it should probably be documented? It didn't take too long to figure out what was going on, but might be nice to mention. |
Nobody has raised that issue before, therefore I don't think it would affect many users. I don't think that many people set expectations in after or a suffix of the around block, therefore I'm even keen on releasing a minor version with that change, and treat previous implementation with after hook as a flaw. I'd like to avoid configuration toggles as it only leads to complexity. |
Perfect. Well, let me know what the next steps are. |
We've had issues recently caused by the order in which The reason was that if I have identified a few different ways to fix that:
Lines 36 to 38 in 382d84c
It seems that using |
@davidstosik thank you for the useful feedback. @drews256 ok, let's give it a try. I see it as an improvements, but we can rollback this change in case we get any complaints. |
This is now released as version 3.9.0 |
I was recently working on mocking out some requests and ran into an issue where I was using webmock to forward mocked requests to a rack app.
I had wrapped a bunch of specs like:
And was surprised when
some_mocking_teardown
was throwing errors about me attempting my mocking teardown.I am able to successfully accomplish what I need by doing:
I would expect either option to work.
I have included a proposed pr to only reset webmock after the
config.around(:each)
in the webmock configuration.Thoughts on this?