hspec-wai-0.8.0: Experimental Hspec support for testing WAI applications

Safe Haskell | None
Language | Haskell2010

Test.Hspec.Wai.Internal

Synopsis

- type WaiExpectation = WaiSession ()
- newtype WaiSession a = WaiSession {
  - unWaiSession :: Session a
  }
- runWaiSession :: WaiSession a -> Application -> IO a
- withApplication :: Application -> WaiSession a -> IO a
- getApp :: WaiSession Application
- formatHeader :: Header -> String

# Documentation

type WaiExpectation = WaiSession () Source #

An expectation in the `WaiSession` monad. Failing expectations are communicated through exceptions (similar to `Expectation` and `Assertion`).

newtype WaiSession a Source #

A WAI test session that carries the `Application` under test and some client state.

Constructors

WaiSession |

Fields

- unWaiSession :: Session a

Instances

Monad WaiSession Source # |
Methods (>>=) :: WaiSession a -> (a -> WaiSession b) -> WaiSession b # (>>) :: WaiSession a -> WaiSession b -> WaiSession b # return :: a -> WaiSession a # fail :: String -> WaiSession a #
Functor WaiSession Source # |
Methods fmap :: (a -> b) -> WaiSession a -> WaiSession b # (<$) :: a -> WaiSession b -> WaiSession a #
Applicative WaiSession Source # |
Methods pure :: a -> WaiSession a # (<*>) :: WaiSession (a -> b) -> WaiSession a -> WaiSession b # (*>) :: WaiSession a -> WaiSession b -> WaiSession b # (<*) :: WaiSession a -> WaiSession b -> WaiSession a #
MonadIO WaiSession Source # |
Methods liftIO :: IO a -> WaiSession a #
Example WaiExpectation Source # |
Associated Types type Arg WaiExpectation :: * # Methods evaluateExample :: WaiExpectation -> Params -> (ActionWith (Arg WaiExpectation) -> IO ()) -> ProgressCallback -> IO Result #
Testable WaiExpectation Source # |
Methods toProperty :: WaiExpectation -> WaiProperty Source #
type Arg WaiExpectation Source # |
type Arg WaiExpectation = Application

runWaiSession :: WaiSession a -> Application -> IO a Source #

withApplication :: Application -> WaiSession a -> IO a Source #

getApp :: WaiSession Application Source #

formatHeader :: Header -> String Source #