hspec-1.0.0.1: Behavior Driven Development for Haskell

Safe HaskellSafe-Infered

Test.Hspec.Core

Description

This module contains the core types, constructors, classes, instances, and utility functions common to hspec.

Synopsis

Documentation

data Result Source

The result of running an example.

Constructors

Success 
Pending String 
Fail String 

Instances

data Spec a Source

Constructors

SpecGroup String [Spec a] 
SpecExample String a 

descriptions :: [Spec a] -> [Spec a]Source

DEPRECATED: This is no longer needed (it's just an alias for id now).

it :: Example a => String -> a -> UnevaluatedSpecSource

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)
   ]

data AnyExample Source

An existentially quantified Example. This way they can be mixed within the same set of Specs

Constructors

forall a . Example a => AnyExample a 

Instances

pendingSource

Arguments

:: String

An explanation for why this behavior is pending.

-> Result 

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")
   ]

quantify :: (Show a, Num a, Eq a) => a -> String -> StringSource

Create a more readable display of a quantity of something.