With meck you can easily mock modules in Erlang. You can also perform some basic validations on the mocked modules, such as making sure no unexpected exceptions occurred or looking at the call history.
With meck you can easily mock modules in Erlang. You can also perform some basic validations on the mocked modules, such as making sure no unexpected exceptions occurred or looking at the call history.
Features
- Automatic renaming and restoration of original modules
- Automatic backup and restore of cover data
- Changing return values using sequences and loops of static values
- Pass through: use functions from the original module
- Mock is linked to the creating process (disable with no_link)
- Complete call history showing calls, results and exceptions
- Mocking of sticky modules (using the option unstick)
- Throwing of expected exceptions that keeps the module valid
Resources