hspec-discover: Automatically discover and run Hspec tests

[ library, mit, program, testing ] [ Propose Tags ]

Say you have a driver module for your test suite.

module Main where

import Test.Hspec.Monadic

import qualified FooSpec
import qualified Foo.BarSpec
import qualified BazSpec

main :: IO ()
main = hspecX $ do
  describe "Foo"     FooSpec.spec
  describe "Foo.Bar" Foo.BarSpec.spec
  describe "Baz"     BazSpec.spec

Then you can replace it with the following.

{-# OPTIONS_GHC -F -pgmF hspec-discover #-}

All files with a name that ends in Spec.hs are include in the generated test suite. And it is assumed, that they export a spec of type Test.Hspec.Monadic.Specs.

Full documentation is here: https://github.com/sol/hspec-discover#readme

Versions 0.0.0, 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.1.0, 0.1.0.1, 0.2.0, 2.0.0, 2.0.1, 2.0.2, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.1.6, 2.1.7, 2.1.8, 2.1.9, 2.1.10, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.3.0, 2.3.1, 2.3.2, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.8, 2.5.0, 2.5.1 (info)
Dependencies base (>=4 && <=5), directory, filepath, hspec (==1.1.*) [details]
License MIT
Copyright (c) 2012 Simon Hengel
Author Simon Hengel <sol@typeful.net>
Maintainer Simon Hengel <sol@typeful.net>
Category Testing
Source repo head: git clone https://github.com/sol/hspec-discover
Uploaded by SimonHengel at Wed May 16 06:56:36 UTC 2012
Distributions Arch:2.5.1, Debian:2.2.1, Fedora:2.4.4, FreeBSD:2.1.10, LTSHaskell:2.4.8, NixOS:2.5.1, Stackage:2.5.1, openSUSE:2.4.8
Executables hspec-discover
Downloads 57959 total (447 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user [build log]
Successful builds reported [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees