Mutare.Swoosh (mutare_swoosh v0.1.1)

Copy Markdown View Source

Custom Mutare mutators for Swoosh email semantics.

The families mutate the semantic fields that tests often forget to assert: recipient class, sender, body part, subject, attachments, custom headers, provider options — and delivery itself. Each email-field family also mutates matching Swoosh.Email.new/1 options, so both pipeline construction and compact new options are covered.

[mutators: [:builtins] ++ Mutare.Swoosh.all()]

Mutare.Swoosh.Deliver needs to know the application's mailer module; all/1 configures it in place:

[mutators: [:builtins] ++ Mutare.Swoosh.all(mailer: MyApp.Mailer)]

Without the option the deliver family stays inert (see Mutare.Swoosh.Deliver). mailer: takes one module or a list; every listed mailer records under the one :swoosh_deliver name (list Mutare.Swoosh.Deliver twice with as: to report them separately).

Summary

Functions

This package's Swoosh mutator families, for splicing into :mutators.

The same families with Mutare.Swoosh.Deliver configured

Functions

all()

@spec all() :: [module()]

This package's Swoosh mutator families, for splicing into :mutators.

Mutare.Swoosh.Deliver is included unconfigured and produces no mutations until it is given a mailer: — use all/1 (or list the {Mutare.Swoosh.Deliver, mailer: ...} tuple yourself) to activate it.

all(opts)

@spec all(keyword()) :: [module() | {module(), keyword()}]

The same families with Mutare.Swoosh.Deliver configured:

Mutare.Swoosh.all(mailer: MyApp.Mailer)
Mutare.Swoosh.all(mailer: [MyApp.Mailer, MyApp.AdminMailer])