ghc-mod/test/MonadSpec.hs
Daniel Gröber 0aa3655e08 Fix tests
2015-09-14 10:12:01 +02:00

18 lines
574 B
Haskell

module MonadSpec where
import Test.Hspec
import TestUtils
import Control.Monad.Error.Class
spec :: Spec
spec = do
describe "When using GhcModT in a do block" $
it "a pattern match failure causes a call to `fail` on ErrorT in the monad stack" $ do
(a, _h)
<- runGmOutDef $ runGhcModT defaultOptions $
do
Just _ <- return Nothing
return "hello"
`catchError` (const $ fail "oh noes")
a `shouldBe` (Left $ GMEString "oh noes")