diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-11-19 14:59:55 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-11-19 14:59:55 +0100 |
commit | 88ffd3c5bea6b5e5cb1004173130b5691a7591f6 (patch) | |
tree | 8205d11882dc3a78f6ea03fe0adef390bc023670 /tests/Hakyll/Core | |
parent | 6b5c299ec945cdfea2dbf2df0922f8753588b729 (diff) | |
download | hakyll-88ffd3c5bea6b5e5cb1004173130b5691a7591f6.tar.gz |
Add tests again
Diffstat (limited to 'tests/Hakyll/Core')
-rw-r--r-- | tests/Hakyll/Core/Dependencies/Tests.hs | 6 | ||||
-rw-r--r-- | tests/Hakyll/Core/Provider/Tests.hs | 35 |
2 files changed, 38 insertions, 3 deletions
diff --git a/tests/Hakyll/Core/Dependencies/Tests.hs b/tests/Hakyll/Core/Dependencies/Tests.hs index cf1d682..22d606f 100644 --- a/tests/Hakyll/Core/Dependencies/Tests.hs +++ b/tests/Hakyll/Core/Dependencies/Tests.hs @@ -41,9 +41,9 @@ oldFacts = M.fromList , ("posts/02.md", []) , ("index.md", - [ Pattern "posts/*" ["posts/01.md", "posts/02.md"] - , Identifier "posts/01.md" - , Identifier "posts/02.md" + [ PatternDependency "posts/*" ["posts/01.md", "posts/02.md"] + , IdentifierDependency "posts/01.md" + , IdentifierDependency "posts/02.md" ]) ] diff --git a/tests/Hakyll/Core/Provider/Tests.hs b/tests/Hakyll/Core/Provider/Tests.hs new file mode 100644 index 0000000..9e46893 --- /dev/null +++ b/tests/Hakyll/Core/Provider/Tests.hs @@ -0,0 +1,35 @@ +-------------------------------------------------------------------------------- +{-# LANGUAGE OverloadedStrings #-} +module Hakyll.Core.Provider.Tests + ( tests + ) where + + +-------------------------------------------------------------------------------- +import qualified Data.Map as M +import Test.Framework (Test, testGroup) +import Test.Framework.Providers.HUnit (testCase) +import Test.HUnit (Assertion, assert, (@=?)) + + +-------------------------------------------------------------------------------- +import Hakyll.Core.Provider +import TestSuite.Util + + +-------------------------------------------------------------------------------- +tests :: Test +tests = testGroup "Hakyll.Core.Provider.Tests" + [ testCase "case01" case01 + ] + + +-------------------------------------------------------------------------------- +case01 :: Assertion +case01 = withTestStore $ \store -> do + provider <- newTestProvider store + assert $ resourceExists provider "example.md" + + metadata <- resourceMetadata provider "example.md" + Just "An example" @=? M.lookup "title" metadata + Just "External data" @=? M.lookup "external" metadata |