tasty-hspec-1.1.4: Hspec support for the Tasty test framework.

Safe HaskellNone
LanguageHaskell2010

Test.Tasty.Hspec

Contents

Description

hspec and tasty serve similar purposes; consider using one or the other.

However, in a pinch, this module allows you to run an hspec Spec as a tasty TestTree.

Synopsis

Documentation

testSpecs :: Spec -> IO [TestTree] Source #

Create a list of tasty TestTree from an Hspec Spec. This returns the same tests as testSpec but doesn't create a tasty test group from them.

module Test.Hspec

Examples

The simplest usage of this library involves first creating a TestTree in IO, then running it with defaultMain.

main = do
  spec <- testSpec "spec" mySpec
  defaultMain
    (testGroup "tests"
      [ spec
      , ...
      ])

However, if you don't do any IO during Spec creation, or the IO need not be performed at any particular time relative to other IO actions, it's perfectly fine to use unsafePerformIO.

main = do
  defaultMain
    (testGroup "tests"
      [ unsafePerformIO (testSpec "spec" mySpec)
      , ...
      ])