HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulehspec-2.11.14Haskell2010

Test.Hspec.Runner

  • 10 types
  • 21 values
  • Packagehspec-2.11.14
  • Exports31
  • LanguageHaskell2010
  • LicenceMIT
  • SourceMonad.hs
typetype Spec = SpecWith ()
#

A SpecWith that can be evaluated directly by the hspec function as it does not require any parameters.

valuehspec :: Spec -> IO ()
#

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

Note: hspec handles command-line options and reads config files. This is not always desirable. Use evalSpec and runSpecForest if you need more control over these aspects.

datadata Config
#
valuereadConfig :: Config -> [String] -> IO Config
#

readConfig parses config options from several sources and constructs a Config value. It takes options from:

  1. ~/.hspec (a config file in the user's home directory)

  2. .hspec (a config file in the current working directory)

  3. environment variables starting with HSPEC_

  4. the provided list of command-line options (the second argument to readConfig)

(precedence from low to high)

When parsing fails then readConfig writes an error message to stderr and exits with exitFailure.

When --help is provided as a command-line option then readConfig writes a help message to stdout and exits with exitSuccess.

A common way to use readConfig is:

getArgs >>= readConfig defaultConfig
datadata ResultItem
#
Instances2Eq, Show
  • Eq ResultItemDefined in hspec-core-2.11.14 · Test.Hspec.Core.Runner.Result
  • Show ResultItemDefined in hspec-core-2.11.14 · Test.Hspec.Core.Runner.Result
datadata SpecResult
#
Instances2Eq, Show
  • Eq SpecResultDefined in hspec-core-2.11.14 · Test.Hspec.Core.Runner.Result
  • Show SpecResultDefined in hspec-core-2.11.14 · Test.Hspec.Core.Runner.Result
typetype Path = ([String], String)
#

A Path describes the location of a spec item within a spec tree.

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