Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
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" mySpecdefaultMain
(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 = dodefaultMain
(testGroup
"tests" [unsafePerformIO
(testSpec
"spec" mySpec) , ... ])