Noizu.Comms.Test.Sink (noizu_comms v0.1.0)

Copy Markdown View Source

In-memory test adapter for test://<name> targets.

Delivers an {:comms_test_sink, target, message} message to the caller's mailbox and keeps a process-backed log for simple assertions:

{:ok, _} = Noizu.Comms.send("test://alerts", %{text: "hi"})
assert [{%Target{}, %Message{}} | _] = Noizu.Comms.Test.Sink.log("alerts")

Summary

Functions

Empties the log.

All recorded {target, message} entries (newest first).

Functions

clear()

@spec clear() :: :ok

Empties the log.

log(name \\ nil)

@spec log(String.t() | nil) :: [{Noizu.Comms.Target.t(), Noizu.Comms.Message.t()}]

All recorded {target, message} entries (newest first).