Remove test/*/setup-config before spec

This commit is contained in:
Daniel Gröber 2014-05-03 15:24:37 +02:00
parent 7b98cb0e85
commit 96a54d2148
2 changed files with 2 additions and 8 deletions

View File

@ -19,12 +19,6 @@ import Config (cProjectVersionInt) -- ghc version
ghcVersion :: Int
ghcVersion = read cProjectVersionInt
unconfigure :: IO ()
unconfigure = do
removeFile cabalConfigPath `catch` (\(_ :: SomeException) -> return ())
around' a f = a >> f >> a
spec :: Spec
spec = do
describe "parseCabalFile" $ do
@ -69,8 +63,7 @@ spec = do
describe "cabalGetConfig" $ do
it "can reconfigure a cabal package" $ do
withDirectory_ "test/data/check-test-subdir"
$ around' unconfigure $ do
withDirectory_ "test/data/check-test-subdir" $ do
cradle <- findCradle
cfg <- cabalGetConfig cradle
cfg `shouldSatisfy` not . null

View File

@ -16,4 +16,5 @@ main = do
genGhcPkgCache dir = system $ "ghc-pkg recache --force -f" ++ dir
genSandboxCfg `mapM_` sandboxes
genGhcPkgCache `mapM_` pkgDirs
system "find test -name setup-config -exec rm {} \\;"
hspec spec