Make parseCabalFile use MonadError

This commit is contained in:
Daniel Gröber
2014-08-12 18:11:32 +02:00
parent e345c92edb
commit 87c587993a
6 changed files with 45 additions and 20 deletions

View File

@@ -3,6 +3,7 @@ module MonadSpec where
import Test.Hspec
import Dir
import TestUtils
import Control.Applicative
import Control.Monad.Error.Class
import Language.Haskell.GhcMod.Types
@@ -23,5 +24,4 @@ spec = do
describe "runGhcModT" $
it "complains if the cabal file fails to parse while a sandbox is present" $ withDirectory_ "test/data/broken-cabal" $ do
(a,_) <- runGhcModT defaultOptions (gmCradle <$> ask)
a `shouldSatisfy` (\(Left _) -> True)
shouldReturnError $ runD' (gmCradle <$> ask)