jjh42 / mock

Mocking library for Elixir language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`after` block of with_mock isn't guaranteed to run if linked process exits

spscream opened this issue · comments

If process linked with test failed for some reason after block of with_mock macro isn't guaranteed to run and mocks isn't unloaded correctly, since if linked process exits test process will also exit and after isn't executed.

Here is some related thread: https://groups.google.com/forum/#!msg/elixir-lang-core/NWvFwUWo2QQ/VCLAzwCVBgAJ

May be replace after block with ExUnit.Callbacks.on_exit ?

I don't have much time to work on this anymore, but I'm accepting patches.