Skip to content
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

Overwriting Test::Unit's teardown causes WebMock to not reset #915

Closed
jessebs opened this issue Nov 3, 2020 · 2 comments
Closed

Overwriting Test::Unit's teardown causes WebMock to not reset #915

jessebs opened this issue Nov 3, 2020 · 2 comments

Comments

@jessebs
Copy link
Contributor

jessebs commented Nov 3, 2020

The standard way of having 'end-of-test' logic is to overwrite the teardown method in the test class.

Doing so, however, removes the alias that webmock/test_unit creates, causing WebMock.reset! to not be called.

Calling super in the teardown method avoids this behavior, but that is a non-standard approach and also isn't documented in WebMock (that I could find at least)

@bblimke
Copy link
Owner

bblimke commented Nov 4, 2020

@jessebs do you have any suggestion how to handle it? I don't think test unit has support for callbacks in the same way as e.g RSpec does.

jessebs added a commit to jessebs/webmock that referenced this issue Nov 6, 2020
@jessebs
Copy link
Contributor Author

jessebs commented Nov 6, 2020

See PR #919

bblimke added a commit that referenced this issue Nov 8, 2020
@jessebs jessebs closed this as completed Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants