From 96a54d214836275737f7e46bc2a0f0bdb323a6b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Sat, 3 May 2014 15:24:37 +0200 Subject: [PATCH] Remove test/*/setup-config before spec --- test/CabalApiSpec.hs | 9 +-------- test/Main.hs | 1 + 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/test/CabalApiSpec.hs b/test/CabalApiSpec.hs index f122cda..00e78ab 100644 --- a/test/CabalApiSpec.hs +++ b/test/CabalApiSpec.hs @@ -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 diff --git a/test/Main.hs b/test/Main.hs index 8eea411..bd0c8f8 100644 --- a/test/Main.hs +++ b/test/Main.hs @@ -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