hspec2-0.5.0: Alpha version of Hspec 2.0

Stabilityexperimental
Safe HaskellNone
LanguageHaskell98

Test.Hspec.Core

Contents

Description

This module provides access to Hspec's internals. It is less stable than other parts of the API. For most users Test.Hspec is more suitable!

Synopsis

A type class for examples

class Example e where Source

A type class for examples.

Associated Types

type Arg e Source

Methods

evaluateExample :: e -> Params -> (ActionWith (Arg e) -> IO ()) -> ProgressCallback -> IO Result Source

data Result Source

The result of running an example.

A writer monad for constructing specs

data SpecM a r Source

A writer monad for SpecTree forests.

Instances

runSpecM :: SpecWith a -> IO [SpecTree a] Source

Convert a Spec to a forest of SpecTrees.

fromSpecList :: [SpecTree a] -> SpecWith a Source

Create a Spec from a forest of SpecTrees.

Internal representation of a spec tree

data SpecTree a Source

Internal representation of a spec.

type ActionWith a = a -> IO () Source

An IO action that expects an argument of type a.

mapSpecItem :: (ActionWith a -> ActionWith b) -> (Item a -> Item b) -> SpecWith a -> SpecWith b Source

describe :: String -> [SpecTree a] -> SpecTree a Source

The describe function combines a list of specs into a larger spec.

it :: Example a => String -> a -> SpecTree (Arg a) Source

Create a spec item.