trystan/hspec — Issue #50: Distinguish between error and failure
Author: sol
Created: 2012-02-10 12:10:56+00:00
State: open

HUnit distinguishes between _errors_ and _failures_, hspec makes no such distinction. From a users perspective this has the disadvantage, that it is not immediately clear whether a failed test is due to an exception or a failed assertion. Here is an example:

import Test.Hspec.Monadic
import Test.Hspec.HUnit ()
import Test.HUnit

main :: IO ()
main = hspecX $ do

describe "a failing spec" $ do

it "treats a failed assertion as FAILED" $ do
assertBool "foobar" False

it "treats an exception as FAILED" $ do
error "foobar" :: Assertion