This release is mostly about reducing the complexity of Mox by switching its ownership implementation to use the new nimble_ownership library.
- Add
Mox.deny/3
. - Optimize
Mox.stub_with/2
.
- Support testing in a cluster
- Support a function to retrieve the PID to allow in
Mox.allow/3
- Use
Code.ensure_compiled!
to support better integration with the Elixir compiler
- Fix race condition for when the test process terminates and a new one is started before the DOWN message is processed
- Add
@behaviour
attribute to Mox modules
- Warn if global is used with async mode
- Fix compilation warnings
- Add
:skip_optional_callbacks
option todefmock/2
that allows you to optionally skip the definition of optional callbacks. - Include arguments in
UnexpectedCallError
exceptions
- Use
$callers
to automatically use expectations defined in the calling process ($callers
is set automatically by tasks in Elixir v1.8 onwards) - Creating an allowance in global mode is now a no-op for convenience
- Support registered process names for allowances