View Source Mockable (Mockable v0.2.2)

Documentation for Mockable.

Summary

Functions

Configures which module to use for a given mockable module. If no implementation is provided, the mockable module itself will be used.

Configures an implementation to be used only for the duration of the given function. This is used internally and is not expected to be useful for end users, but is documented for completeness.

Functions

Link to this function

log_implementation_usage(implementation, function_name, arity, module)

View Source
Link to this function

use(mockable, implementation \\ nil)

View Source

Configures which module to use for a given mockable module. If no implementation is provided, the mockable module itself will be used.

This is useful for testing your Mockable module.

Mockable.use(Client)

Or to use a specific implementation:

Mockable.use(Client, ClientMock)

This function stores the configuration in process memory so that it is compatible with async tests.

Link to this function

use(mockable, implementation, func)

View Source

Configures an implementation to be used only for the duration of the given function. This is used internally and is not expected to be useful for end users, but is documented for completeness.