A relay for ExUnit tests, reached over TCP and stopped with the test.
%ExMoQ.Relay.Info{tcp: url} = ExMoQ.Testing.Relay.start_supervised!()To stop it before the test ends, start it with ExUnit directly:
relay = start_supervised!({ExMoQ.Relay, ExMoQ.Testing.Relay.options()}, id: :relay)
ExMoQ.Relay.info(relay).tcp
stop_supervised!(:relay)
Summary
Functions
@spec free_port() :: :inet.port_number()
A TCP port nothing listens on right now, for a relay to bind.
@spec options(Path.t() | nil) :: ExMoQ.Relay.options()
Options for a test relay: TCP only, on a port that is free as they are built.
@spec start_supervised!(Path.t() | nil) :: ExMoQ.Relay.Info.t()
Starts a relay with options/1 under the test supervisor and blocks until
it is ready.
Raises if there is no binary, or the relay exits or is not ready in time.