detour v0.1.0 Detour.Assertions

Assertions used for testing email deliverability.

Link to this section Summary

Functions

Asserts that a specific message has been delivered within the timeout period, specified in milliseconds.

Asserts that a number of messages have been delivered within the timeout period, specified in milliseconds.

Asserts that a message has not been delivered within the timeout period, specified in milliseconds.

Link to this section Functions

Link to this macro

assert_message_delivered(message, timeout \\ 150, failure_message \\ nil)

(macro)

Asserts that a specific message has been delivered within the timeout period, specified in milliseconds.

timeout has a default of 150 milliseconds.

The message argument must match the pattern {from, [to], body}.

Note that body must be the data expected to be received by an SMTP server. This is typically an RFC2822 encoded string.

Examples

assert_message_delivered {"me@notyou.com", ["you@notme.com"], message}
Link to this macro

assert_number_of_messages_delivered(expected, timeout \\ 150, failure_message \\ nil)

(macro)

Asserts that a number of messages have been delivered within the timeout period, specified in milliseconds.

timeout has a default of 150 milliseconds.

Example

assert_number_of_messages_delivered 3
Link to this macro

refute_message_delivered(message, timeout \\ 150, failure_message \\ nil)

(macro)

Asserts that a message has not been delivered within the timeout period, specified in milliseconds.

timeout has a default of 150 milliseconds.

The message argument must match the pattern {from, [to], body}.

Note that body must be the data expected to be received by an SMTP server. This is typically an RFC2822 encoded string.

Example

refute_message_delivered {"me@notyou.com", ["you@notme.com"], message}