Pavlov.Mocks.Matchers
Provides matchers for Mocked modules.
Summary↑
called(arg1) | Asserts whether a method was called when using “Asserts” syntax: |
to_have_received(module, tuple) | Asserts whether a method was called with on a mocked module.
Use in conjunction with |
with(method, args) | Use in conjunction with |
Functions
Asserts whether a method was called with on a mocked module.
Use in conjunction with with
to perform assertions on the arguments
passed in to the method.
A negative version not_to_have_received
is also provided. The same usage
instructions apply.
Example
expect HTTPotion |> to_have_received :get
Use in conjunction with to_have_received
to perform assertions on the
arguments passed in to the given method.
Example
expect HTTPotion |> to_have_received :get |> with "http://example.com"
Macros
Asserts whether a method was called when using “Asserts” syntax:
Example
assert called HTTPotion.get("http://example.com")