fixing tests for logging

This commit is contained in:
Nicolas Rolland
2015-11-25 16:06:24 +01:00
parent 1a8020774e
commit e1d2de96c8
4 changed files with 14 additions and 9 deletions

View File

@@ -8,7 +8,6 @@ import System.Directory (canonicalizePath)
import System.FilePath (pathSeparator)
import Test.Hspec
import TestUtils
import Prelude
import Dir
@@ -37,14 +36,14 @@ spec = do
it "returns the current directory" $ do
withDirectory_ "/" $ do
curDir <- stripLastDot <$> canonicalizePath "/"
res <- clean_ $ runGmOutDef findCradle
res <- clean_ $ runGmOutDef findCradleNoLog
cradleCurrentDir res `shouldBe` curDir
cradleRootDir res `shouldBe` curDir
cradleCabalFile res `shouldBe` Nothing
it "finds a cabal file and a sandbox" $ do
withDirectory "test/data/cabal-project/subdir1/subdir2" $ \dir -> do
res <- relativeCradle dir <$> clean_ (runGmOutDef findCradle)
res <- relativeCradle dir <$> clean_ (runGmOutDef findCradleNoLog)
cradleCurrentDir res `shouldBe`
"test/data/cabal-project/subdir1/subdir2"
@@ -56,7 +55,7 @@ spec = do
it "works even if a sandbox config file is broken" $ do
withDirectory "test/data/broken-sandbox" $ \dir -> do
res <- relativeCradle dir <$> clean_ (runGmOutDef findCradle)
res <- relativeCradle dir <$> clean_ (runGmOutDef findCradleNoLog)
cradleCurrentDir res `shouldBe`
"test" </> "data" </> "broken-sandbox"