mockery v2.3.0 Mockery.History View Source

Provides calls history for Mockery.Assertions macros.

It’s disabled by default. It can be enabled/disabled globally by following config

config :mockery, history: true

Or for single test process

Mockery.History.enable_history()
Mockery.History.disable_history()

Process config has higher priority than global config

Link to this section Summary

Functions

Disables history in scope of single test process

Enables history in scope of single test process

Link to this section Functions

Link to this function disable_history() View Source
disable_history() :: :ok

Disables history in scope of single test process

use Mockery

test "example" do
  #...

  disable_history()
  assert_called Foo, :bar, [_, :a]
end
Link to this function enable_history() View Source
enable_history() :: :ok

Enables history in scope of single test process

use Mockery

test "example" do
  #...

  enable_history()
  assert_called Foo, :bar, [_, :a]
end
Link to this function enable_history(enabled) View Source
enable_history(enabled :: boolean()) :: :ok
This function is deprecated. Use enable_history/0 or disable_history/0 instead.