ldap-client/test/Ldap/ClientSpec.hs
Matvey Aksenov aea85536cf React on Unsolicited Notifications
Also improves the behavior when an `IOException` is encountered:
only exceptions directly related to LDAP are trapped by `with`.
2015-04-04 17:41:40 +00:00

19 lines
378 B
Haskell
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

module Ldap.ClientSpec (spec) where
import Control.Exception (IOException, throwIO)
import Test.Hspec
import SpecHelper (locally)
spec :: Spec
spec =
context "exceptions" $
it "propagates unrelated IOExceptions through" $
locally (\_ -> throwIO unrelated)
`shouldThrow`
(== unrelated)
unrelated :: IOException
unrelated = userError "unrelated"