View Source Mockery.History (mockery v2.3.3)

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

Summary

Functions

Disables history in scope of single test process

Enables history in scope of single test process

Functions

@spec disable_history() :: :ok

Disables history in scope of single test process

use Mockery

test "example" do
  #...

  disable_history()
  assert_called Foo, :bar, [_, :a]
end
@spec enable_history() :: :ok

Enables history in scope of single test process

use Mockery

test "example" do
  #...

  enable_history()
  assert_called Foo, :bar, [_, :a]
end
This function is deprecated. Use enable_history/0 or disable_history/0 instead.
@spec enable_history(enabled :: boolean()) :: :ok