sandwich-contexts-0.3.0.2: Contexts for the Sandwich test library
Safe HaskellNone
LanguageHaskell2010

Test.Sandwich.Contexts.FakeSmtpServer

Description

This module provides functions for introducing a mock SMTP server, represented by FakeSmtpServer.

If you send emails to this server, you can read them out to confirm they were received correctly.

Synopsis

Introduce a fake SMTP server

introduceFakeSmtpServerNix Source #

Arguments

:: forall context (m :: Type -> Type). (BaseMonad context m, HasNixContext context) 
=> FakeSmtpServerOptions

Options

-> SpecFree (FakeSmtpServerContext context) m ()

Child spec

-> SpecFree context m ()

Parent spec

Introduce a fake SMTP server using a Nix derivation hardcoded into this package as fakeSmtpServerDerivation.

introduceFakeSmtpServerNix' Source #

Arguments

:: forall context (m :: Type -> Type). (BaseMonad context m, HasNixContext context) 
=> Text

Nix derivation

-> FakeSmtpServerOptions

Options

-> SpecFree (FakeSmtpServerContext context) m ()

Child spec

-> SpecFree context m ()

Parent spec

Same as introduceFakeSmtpServerNix, but allows you to specify the derivation.

introduceFakeSmtpServer Source #

Arguments

:: forall context (m :: Type -> Type). (BaseMonad context m, HasFile context "fake-smtp-server") 
=> FakeSmtpServerOptions

Options

-> SpecFree (LabelValue "fakeSmtpServer" FakeSmtpServer :> context) m () 
-> SpecFree context m () 

Introduce a fake SMTP server given a binary already available via HasFile.

Bracket-style version

withFakeSMTPServer Source #

Arguments

:: (BaseMonad context m, MonadReader context m, MonadLoggerIO m, HasFile context "fake-smtp-server") 
=> FakeSmtpServerOptions

Options

-> (FakeSmtpServer -> m [Result]) 
-> m () 

Bracket-style version of introduceFakeSmtpServer.

Nix derivation

Types

data FakeSmtpServerOptions Source #

Constructors

FakeSmtpServerOptions 

Fields

data FakeSmtpServer Source #

Constructors

FakeSmtpServer 

Fields