hspec2-0.4.1: Alpha version of Hspec 2.0

Stabilityexperimental
Safe HaskellNone

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 whereSource

A type class for examples.

Associated Types

type Arg e 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 aSource

Create a Spec from a forest of SpecTrees.

Internal representation of a spec tree

data SpecTree a Source

Internal representation of a spec.

data Item a Source

Constructors

Item 

type ActionWith a = a -> IO ()Source

An IO action that expects an argument of type a.

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

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

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

Create a spec item.