Also improves the behavior when an `IOException` is encountered: only exceptions directly related to LDAP are trapped by `with`.
19 lines
378 B
Haskell
19 lines
378 B
Haskell
module Ldap.ClientSpec (spec) where
|
||
|
||
import Control.Exception (IOException, throwIO)
|
||
import Test.Hspec
|
||
|
||
import SpecHelper (locally)
|
||
|
||
|
||
spec :: Spec
|
||
spec =
|
||
context "exceptions" $
|
||
it "propagates unrelated ‘IOException’s through" $
|
||
locally (\_ -> throwIO unrelated)
|
||
`shouldThrow`
|
||
(== unrelated)
|
||
|
||
unrelated :: IOException
|
||
unrelated = userError "unrelated"
|