hspec-expectations-0.8.4: Catchy combinators for HUnit
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Hspec.Expectations.Contrib

Description

Experimental combinators, that may become part of the main distribution, if they turn out to be useful for a wider audience.

Synopsis

Predicates

(useful in combination with shouldSatisfy)

isLeft :: Either a b -> Bool #

isRight :: Either a b -> Bool #

Annotating expectations

annotate :: String -> IO a -> IO a Source #

If you have a test case that has multiple assertions, you can use the annotate function to provide a string message that will be attached to the Expectation.

describe "annotate" $ do
  it "adds the message" $ do
    annotate "obvious falsehood" $ do
      True shouldBe False

========>

1) annotate, adds the message
      obvious falsehood
      expected: False
       but got: True

Since: 0.8.3