View Source nuntius_mocker (nuntius v0.0.3)
Link to this section Summary
Functions
Reregisters the mocked process with its name, thus removing the mock.
Removes an expect function.
Adds a new expect function to a mocked process.
Returns the list of expect functions for a process.
Returns the history of messages received by a mocked process.
Returns the PID of the currently mocked process.
Returns the PID of a mocked process (the original one with that name).
Passes the current message down to the mocked process.
Passes a message down to the mocked process.
Returns whether a particular message was received already.
Erases the history for a mocked process. Note that there is no gen:cast(...), gen_server and others basically just send the message and move on, like us.
Boots up a mocking process. If the process to be mocked doesn't exist, returns
ignore
.Link to this section Functions
-spec delete(nuntius:process_name()) -> ok.
-spec delete(nuntius:process_name(), nuntius:expect_id()) -> ok.
-spec expect(nuntius:process_name(), nuntius:expect_id(), nuntius:expect_fun()) -> ok.
-spec expects(nuntius:process_name()) -> {ok, #{nuntius:expect_id() => nuntius:expect_fun()}}.
-spec history(nuntius:process_name()) -> [nuntius:event()].
-spec init(nuntius:process_name(), pid(), nuntius:opts()) -> no_return().
-spec mocked_process() -> pid().
-spec mocked_process(nuntius:process_name()) -> pid().
-spec passthrough() -> ok.
-spec passthrough(term()) -> ok.
-spec received(nuntius:process_name(), term()) -> boolean().
-spec reset_history(nuntius:process_name()) -> ok.
-spec start_link(nuntius:process_name(), nuntius:opts()) -> {ok, pid()} | ignore.
ignore
.