hspec-1.8.1: Behavior-Driven Development for Haskell

Stabilityprovisional
Safe HaskellNone

Test.Hspec.Runner

Contents

Description

 

Synopsis

Running a spec

hspec :: Spec -> IO ()Source

Run given spec and write a report to stdout. Exit with exitFailure if at least one spec item fails.

hspecResult :: Spec -> IO SummarySource

Run given spec and returns a summary of the test run.

Note: hspecResult does not exit with exitFailure on failing spec items. If you need this, you have to check the Summary yourself and act accordingly.

hspecWith :: Config -> Spec -> IO SummarySource

Run given spec with custom options and returns a summary of the test run.

Note: hspecWith does not exit with exitFailure on failing spec items. If you need this, you have to check the Summary yourself and act accordingly.

Types

data Summary Source

Summary of a test run.

Constructors

Summary 

data Config Source

Constructors

Config 

Fields

configDryRun :: Bool
 
configPrintCpuTime :: Bool
 
configFastFail :: Bool
 
configFilterPredicate :: Maybe (Path -> Bool)

A predicate that is used to filter the spec before it is run. Only examples that satisfy the predicate are run.

configQuickCheckArgs :: Args
 
configSmallCheckDepth :: Int
 
configColorMode :: ColorMode
 
configFormatter :: Formatter
 
configHtmlOutput :: Bool
 
configHandle :: Either Handle FilePath
 

type Path = ([String], String)Source

A tuple that represents the location of an example within a spec.

It consists of a list of group descriptions and a requirement description.

configAddFilter :: (Path -> Bool) -> Config -> ConfigSource

Add a filter predicate to config. If there is already a filter predicate, then combine them with ||.

Internals

hspecWithFormatter :: IsFormatter a => a -> Spec -> IO ()Source

This function is used by hspec-discover. It is not part of the public API and may change at any time.