Add test to check package id extraction

This commit add a failing test to check extracting package id. The test will
fail with the following output for now:

1) Cradle.getPackageDbPackages find a config file and extracts packages with their ids
expected: [("template-haskell",Just "template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c")]
 but got: []
This commit is contained in:
Naohiro Aota
2014-01-30 20:09:57 +09:00
parent a0db24b0a5
commit 04022ab0ac
4 changed files with 108 additions and 0 deletions

View File

@@ -53,6 +53,11 @@ spec = do
it "throws an error if a config file is broken" $ do
getPackageDbDir "test/data/bad.config" `shouldThrow` anyException
describe "getPackageDbPackages" $ do
it "find a config file and extracts packages with their ids" $ do
pkgs <- getPackageDbPackages "test/data/check-packageid"
pkgs `shouldBe` [("template-haskell", Just "template-haskell-2.8.0.0-32d4f24abdbb6bf41272b183b2e23e9c")]
relativeCradle :: FilePath -> Cradle -> Cradle
relativeCradle dir cradle = cradle {
cradleCurrentDir = toRelativeDir dir $ cradleCurrentDir cradle