Safe Haskell | Safe-Infered |
---|
This module contains the core types, constructors, classes, instances, and utility functions common to hspec.
- data Result
- data Spec
- = Spec { }
- | UnevaluatedSpec {
- name :: String
- requirement :: String
- example :: AnyExample
- depth :: Int
- data Formatter = Formatter {
- formatterName :: String
- exampleGroupStarted :: Handle -> Spec -> IO ()
- examplePassed :: Handle -> Spec -> [String] -> IO ()
- exampleFailed :: Handle -> Spec -> [String] -> IO ()
- examplePending :: Handle -> Spec -> [String] -> IO ()
- errorsFormatter :: Handle -> [String] -> IO ()
- footerFormatter :: Handle -> [Spec] -> Double -> IO ()
- usesFormatting :: Bool
- describe :: String -> [[Spec]] -> [Spec]
- descriptions :: [[Spec]] -> [Spec]
- evaluateSpec :: Spec -> IO Spec
- it :: Example a => String -> a -> [Spec]
- class Example a where
- evaluateExample :: a -> IO Result
- data AnyExample = forall a . Example a => AnyExample a
- pending :: String -> Result
- failedCount :: [Spec] -> Int
- failure :: [Spec] -> Bool
- success :: [Spec] -> Bool
- isFailure :: Result -> Bool
- quantify :: (Show a, Num a, Eq a) => a -> String -> String
Documentation
The result of running an example.
Everything needed to specify and show a specific behavior.
Spec | |
| |
UnevaluatedSpec | |
|
Formatter | |
|
descriptions :: [[Spec]] -> [Spec]Source
Combine a list of descriptions.
evaluateSpec :: Spec -> IO SpecSource
it :: Example a => String -> a -> [Spec]Source
Create a set of specifications for a specific type being described. Once you know what you want specs for, use this.
describe "abs" [ it "returns a positive number given a negative number" (abs (-1) == 1) ]
evaluateExample :: a -> IO ResultSource
data AnyExample Source
An existentially quantified Example
. This way they can be mixed within the same set of Specs
forall a . Example a => AnyExample a |
Declare an example as not successful or failing but pending some other work. If you want to report on a behavior but don't have an example yet, use this.
describe "fancyFormatter" [ it "can format text in a way that everyone likes" (pending "waiting for clarification from the designers") ]
failedCount :: [Spec] -> IntSource