hspec-wai-0.9.2: 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 # |
Instance details Defined in Test.Hspec.Wai.Internal Methods (>>=) :: WaiSession a -> (a -> WaiSession b) -> WaiSession b Source # (>>) :: WaiSession a -> WaiSession b -> WaiSession b Source # return :: a -> WaiSession a Source # fail :: String -> WaiSession a Source #
Functor WaiSession Source # |
Instance details Defined in Test.Hspec.Wai.Internal Methods fmap :: (a -> b) -> WaiSession a -> WaiSession b Source # (<$) :: a -> WaiSession b -> WaiSession a Source #
MonadFail WaiSession Source # |
Instance details Defined in Test.Hspec.Wai.Internal Methods fail :: String -> WaiSession a Source #
Applicative WaiSession Source # |
Instance details Defined in Test.Hspec.Wai.Internal Methods pure :: a -> WaiSession a Source # (<*>) :: WaiSession (a -> b) -> WaiSession a -> WaiSession b Source # liftA2 :: (a -> b -> c) -> WaiSession a -> WaiSession b -> WaiSession c Source # (*>) :: WaiSession a -> WaiSession b -> WaiSession b Source # (<*) :: WaiSession a -> WaiSession b -> WaiSession a Source #
MonadIO WaiSession Source # |
Instance details Defined in Test.Hspec.Wai.Internal Methods liftIO :: IO a -> WaiSession a Source #
Example WaiExpectation Source # |
Instance details Defined in Test.Hspec.Wai.Internal Associated Types type Arg WaiExpectation :: Type Source # Methods evaluateExample :: WaiExpectation -> Params -> (ActionWith (Arg WaiExpectation) -> IO ()) -> ProgressCallback -> IO Result Source #
Testable WaiExpectation Source # |
Instance details Defined in Test.Hspec.Wai.QuickCheck Methods toProperty :: WaiExpectation -> WaiProperty Source #
type Arg WaiExpectation Source # |
Instance details Defined in Test.Hspec.Wai.Internal 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 #