ghc-mod/test/GhcPkgSpec.hs
Daniel Gröber 241c7946fc Revert "Fix tests for Cabal <= 1.16"
The problem the reverted commit tried to fix seems to have been just a
symptom of another root cause that was later fixed as the problem does
not seem to occur anymore even without this changeset also this
changeset broke cabal sandboxes with ghc < 7.8.

Fix #262

This reverts commit 8741323f5b.

Conflicts:
	Language/Haskell/GhcMod/GhcPkg.hs
2014-05-19 01:27:35 +02:00

19 lines
593 B
Haskell

module GhcPkgSpec where
import Language.Haskell.GhcMod.GhcPkg
import System.Directory
import System.FilePath ((</>))
import Test.Hspec
spec :: Spec
spec = do
describe "getSandboxDb" $ do
it "parses a config file and extracts sandbox package db" $ do
cwd <- getCurrentDirectory
pkgDb <- getSandboxDb "test/data/"
pkgDb `shouldBe` (cwd </> "test/data/.cabal-sandbox/i386-osx-ghc-7.6.3-packages.conf.d")
it "throws an error if a config file is broken" $ do
getSandboxDb "test/data/broken-sandbox" `shouldThrow` anyException