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

:meck.unload on exit #101

Merged
merged 1 commit into from
Mar 21, 2019
Merged

Conversation

kelostrada
Copy link
Contributor

When running tests using setup_with_mock the mocks aren't actually unloaded fast enough (or maybe not at all) and sometimes they pass through to other tests (which don't want the mocks to be active at all). All the tests I did were on async: false and this still happened. Then I noticed you don't unload explicitly the mocks so hence the PR. I unload the mocks globally using :meck.unload() but I figure you don't want to use the mocks in different tests (setting them in one test and unloading in different) as the loading/unloading is indeterministic. I'm convinced it's pretty safe to unload all the mocks at the end of the test every time the test is finished. This happens in ExUnit's on_exit.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 4d61eb6 on Gamecode-HQ:fix_setup_with_mocks into f5b8a37 on jjh42:master.

@Olshansk
Copy link
Collaborator

Seeing how all the tests in mock_setup_test.exs pass, it looks pretty safe to me as well.

Thanks for your contribution!

@Olshansk Olshansk merged commit 2520764 into jjh42:master Mar 21, 2019
@liskin
Copy link

liskin commented Nov 28, 2019

@Olshansk This PR fixes an issue that we're experiencing. Can you please make a release with this fix? Thanks a lot!

@Olshansk
Copy link
Collaborator

Olshansk commented Dec 1, 2019

Done!

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

Successfully merging this pull request may close these issues.

4 participants