| Safe Haskell | None |
|---|
Test.Hspec.Monadic
Contents
Description
Deprecated: use "Test.Hspec", "Test.Hspec.Runner" or "Test.Hspec.Core" instead
- type Spec = SpecM ()
- class Example a
- data Pending
- describe :: String -> Spec -> Spec
- context :: String -> Spec -> Spec
- it :: Example v => String -> v -> Spec
- pending :: String -> Pending
- hspec :: Spec -> IO ()
- data Summary = Summary {}
- runSpecM :: Spec -> [SpecTree]
- fromSpecList :: [SpecTree] -> Spec
- type Specs = Spec
- descriptions :: [Spec] -> Spec
- hspecB :: Spec -> IO Bool
- hspecX :: Spec -> IO ()
- hHspec :: Handle -> Spec -> IO Summary
Types
A type class for examples.
Defining a spec
it :: Example v => String -> v -> SpecSource
Create a spec item.
A spec item consists of:
- a textual description of a desired behavior
- an example for that behavior
describe "absolute" $ do
it "returns a positive number when given a negative number" $
absolute (-1) == 1
pending :: String -> PendingSource
A pending example.
If you want to textually specify a behavior but do not have an example yet, use this:
describe "fancyFormatter" $ do
it "can format text in a way that everyone likes" $
pending
You can give an optional reason for why it's pending:
describe "fancyFormatter" $ do
it "can format text in a way that everyone likes" $
pending "waiting for clarification from the designers"
Running a spec
Run given spec and write a report to stdout.
Exit with exitFailure if at least one spec item fails.
(see also hspecWith)
Summary of a test run.
Constructors
| Summary | |
Fields
| |
Interface to the non-monadic API
Deprecated types and functions
descriptions :: [Spec] -> SpecSource