File: FormatSpec.hs

package info (click to toggle)
haskell-hspec-core 2.11.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 656 kB
  • sloc: haskell: 8,945; makefile: 5
file content (19 lines) | stat: -rw-r--r-- 538 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module Test.Hspec.Core.FormatSpec (spec) where

import           Prelude ()
import           Helper

import           Test.Hspec.Core.Format

spec :: Spec
spec = do
  describe "monadic" $ do
    context "on exception" $ do
      it "propagates" $ do
        format <- monadic id (\ _ -> throwIO DivideByZero)
        format (Done []) `shouldThrow` (== DivideByZero)

      it "does not hang" $ do
        format <- monadic id (\ _ -> throwIO DivideByZero)
        format (Done []) `shouldThrow` (== DivideByZero)
        format (Done [])