MecksUnit: Elegantly mock module functions in (async) ExUnit tests

Haven’t tried that yet to be honest. But my guess is that the defined module within the describe block still only counts for the first mocked_test that is encountered.

How would you like it to behave? Can you give a pseudo code example?

The problem with MecksUnit not mocking modules in some cases is related to this issue: https://github.com/archan937/mecks_unit/issues/4

It works fine only when the mix task is run without arguments or when the test file is present among the arguments (which is the experience you describe).

Also working in version 1.2 and not working in version 1.3 points to that this was introduced in https://github.com/archan937/mecks_unit/commit/12862b6.

1 Like

I stopped using MecksUnit in favour of Mox. Mox enforces better code architecture anyway. I simply spent to much time on it, and later did some other things without any mocking, and I even forgot about this whole topic until your message :slight_smile:

Hey @hrubi (and @sztosz), the bugfix has been released in MecksUnit v0.1.9.

Really sorry for the late reply :pray: :v:

1 Like