hspec2-0.3.0: Alpha version of Hspec 2.0

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 

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.