Safe Haskell | None |
---|
Deprecated: use Test.Hspec, Test.Hspec.Runner or Test.Hspec.Core instead
- type Spec = SpecM ()
- class Example a
- describe :: String -> Spec -> Spec
- context :: String -> Spec -> Spec
- it :: Example v => String -> v -> Spec
- pending :: Expectation
- 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
Specifies 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
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.
Interface to the non-monadic API
Deprecated types and functions
descriptions :: [Spec] -> SpecSource