trystan/hspec — Issue #38: Ctrl-C is not handled properly
Author: sol
Created: 2011-12-01 12:04:11+00:00
State: open

Test run is not abort on `ctrl-c`. Here is a minimal example, that reproduces the issue:

import Test.Hspec.Monadic

fib :: Int -> Int
fib 0 = 1
fib 1 = 1
fib n = fib (n - 1) + fib (n - 2)

main = hspec $ do
it "foo" $ fib 100 == 0
it "bar" $ fib 100 == 0
it "baz" $ fib 100 == 0

If you run this and press `ctrl-c`, only one test is abort, not the whole test run.

We had the same issue in HUnit, but this is fixed in 1.2.4.2.