hspec-core-2.11.12: A Testing Framework for Haskell
Safe HaskellNone
LanguageHaskell2010

Test.Hspec.Core.Extension.Item

Description

Warning: This API is experimental.

Synopsis

Types

data Item a Source #

Item is used to represent spec items internally. A spec item consists of:

  • a textual description of a desired behavior
  • an example for that behavior
  • additional meta information

Everything that is an instance of the Example type class can be used as an example, including QuickCheck properties, Hspec expectations and HUnit assertions.

Constructors

Item 

Fields

data Location Source #

Location is used to represent source locations.

Constructors

Location 

Fields

Instances

Instances details
Read Location Source # 
Instance details

Defined in Test.Hspec.Core.Example.Location

Methods

readsPrec :: Int -> ReadS Location

readList :: ReadS [Location]

readPrec :: ReadPrec Location

readListPrec :: ReadPrec [Location]

Show Location Source # 
Instance details

Defined in Test.Hspec.Core.Example.Location

Methods

showsPrec :: Int -> Location -> ShowS

show :: Location -> String

showList :: [Location] -> ShowS

Eq Location Source # 
Instance details

Defined in Test.Hspec.Core.Example.Location

Methods

(==) :: Location -> Location -> Bool

(/=) :: Location -> Location -> Bool

data Params Source #

Constructors

Params 

Fields

Instances

Instances details
Show Params Source # 
Instance details

Defined in Test.Hspec.Core.Example

Methods

showsPrec :: Int -> Params -> ShowS

show :: Params -> String

showList :: [Params] -> ShowS

type ActionWith a = a -> IO () Source #

An IO action that expects an argument of type a

type Progress = (Int, Int) Source #

data Result Source #

The result of running an example

Constructors

Result 

Fields

Instances

Instances details
Show Result Source # 
Instance details

Defined in Test.Hspec.Core.Example

Methods

showsPrec :: Int -> Result -> ShowS

show :: Result -> String

showList :: [Result] -> ShowS

Example Result Source # 
Instance details

Defined in Test.Hspec.Core.Example

Associated Types

type Arg Result 
Instance details

Defined in Test.Hspec.Core.Example

type Arg Result = ()
Example (a -> Result) Source # 
Instance details

Defined in Test.Hspec.Core.Example

Associated Types

type Arg (a -> Result) 
Instance details

Defined in Test.Hspec.Core.Example

type Arg (a -> Result) = a

Methods

evaluateExample :: (a -> Result) -> Params -> (ActionWith (Arg (a -> Result)) -> IO ()) -> ProgressCallback -> IO Result Source #

type Arg Result Source # 
Instance details

Defined in Test.Hspec.Core.Example

type Arg Result = ()
type Arg (a -> Result) Source # 
Instance details

Defined in Test.Hspec.Core.Example

type Arg (a -> Result) = a

data ResultStatus Source #

Constructors

Success 
Pending (Maybe Location) (Maybe String) 
Failure (Maybe Location) FailureReason 

Instances

Instances details
Exception ResultStatus Source # 
Instance details

Defined in Test.Hspec.Core.Example

Methods

toException :: ResultStatus -> SomeException

fromException :: SomeException -> Maybe ResultStatus

displayException :: ResultStatus -> String

Show ResultStatus Source # 
Instance details

Defined in Test.Hspec.Core.Example

Methods

showsPrec :: Int -> ResultStatus -> ShowS

show :: ResultStatus -> String

showList :: [ResultStatus] -> ShowS

data FailureReason Source #

Constructors

NoReason 
Reason String 
ColorizedReason String 
ExpectedButGot (Maybe String) String String 
Error (Maybe String) SomeException 

Instances

Instances details
Show FailureReason Source # 
Instance details

Defined in Test.Hspec.Core.Example

Methods

showsPrec :: Int -> FailureReason -> ShowS

show :: FailureReason -> String

showList :: [FailureReason] -> ShowS

NFData FailureReason Source # 
Instance details

Defined in Test.Hspec.Core.Example

Methods

rnf :: FailureReason -> ()

Operations

isFocused :: Item a -> Bool Source #

pendingWith :: String -> Item a -> Item a Source #

setAnnotation :: Typeable value => value -> Item a -> Item a Source #

getAnnotation :: Typeable value => Item a -> Maybe value Source #