detour v0.1.0 Detour
Link to this section Summary
Functions
Returns the detour struct associated with the current process.
Starts a Detour server.
Stops a running Detour server.
Link to this section Types
Link to this section Functions
Returns the detour struct associated with the current process.
Starts a Detour server.
You can specify a port by providing a value to the :port
option. If a port
isn't provided then a random open port will be used. Note that it is
preferrable to have Detour assign a port for you. When assigning a static port
you run into the risk of address conflicts and limits your ability to run
tests asynchronously.
Returns a %Detour{}
struct that will contain the assigned port. You can pass
this port to your SMTP client with a relay of localhost
to direct all SMTP
traffic to Detour.
shutdown(detour, opts \\ [])
Stops a running Detour server.
Stopping a Detour server will release it's port making it available for
another process. When providing a port to open/1
it's important to perform
a shutdown, otherwise test processes using the same port can conflict.