Safe Haskell | None |
---|---|
Language | Haskell2010 |
Tests
Options
data TreatPendingAs Source #
How to treat hspec
pending tests.
tasty
does not have the concept of pending tests, so we must map them to
either successes or failures. By default, they are treated as failures.
Set via the command line flag --treat-pending-as (success|failure)
.
Instances
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 , ... ])
You can treat an pending
/pendingWith
test as a success instead of a
failure (the default):
tests :: TestTree tests = localOption TreatPendingAsSuccess $ testGroup "My Hspec TestTree" [ unsafePerformIO (testSpec "My first Hspec test" spec_firstHspecTest) , ... ]
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) , ... ])