hspec-0.9.1: Behavior Driven Development for Haskell

Test.Hspec.Runner

Description

This module contains the runners that take a set of specs, evaluate their examples, and report to a given handle.

Synopsis

Documentation

type Specs = [Spec]Source

hspec :: Specs -> IO [Spec]Source

Create a document of the given specs and write it to stdout.

hspecX :: Specs -> IO aSource

Use in place of hspec to also exit the program with an ExitCode

hspecB :: Specs -> IO BoolSource

Use in place of hspec to also give a Bool success indication

hHspec :: Handle -> Specs -> IO SpecsSource

Create a document of the given specs and write it to the given handle.

 writeReport filename specs = withFile filename WriteMode (\ h -> hHspec h specs)

hHspecWithFormat :: Formatter -> Handle -> Specs -> IO SpecsSource

Create a document of the given specs and write it to the given handle. THIS IS LIKELY TO CHANGE

it :: Example a => String -> a -> [Spec]Source

Create a set of specifications for a specific type being described. Once you know what you want specs for, use this.

 describe "abs" [
   it "returns a positive number given a negative number"
     (abs (-1) == 1)
   ]