Promox.expect
You're seeing just the function
expect
, go back to Promox module for more information.
Link to this function
expect(mock, protocol, name, n \\ 1, code)
Expects the protocol.name
callback with arity given by code
to be invoked with mock
n
times.
Examples
To expect MyProtocol.callback/1
to be called once:
my_mock =
Promox.new()
|> Promox.expect(MyProtocol, :callback, fn _mock -> :ok end)
To expect MyProtocol.callback/1
to be called five times:
my_mock =
Promox.new()
|> Promox.expect(MyProtocol, :callback, 5, fn _mock -> :ok end)