summaryrefslogtreecommitdiff
path: root/tests/Hakyll
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2014-01-23 01:29:01 -0800
committerJasper Van der Jeugt <jaspervdj@gmail.com>2014-01-23 01:29:01 -0800
commit63107a6f75335cabe828751d2bef4704667cad76 (patch)
tree36aebb3a2142deed11f5e0366c7092bb19cff82a /tests/Hakyll
parentbc360a3f4654d0d32c00c408c170aaede24f1b17 (diff)
parentdbabe0325b9d7bca3b14c2b33e686b8151fa79aa (diff)
downloadhakyll-63107a6f75335cabe828751d2bef4704667cad76.tar.gz
Merge pull request #190 from krsch/master
Implemented per-directory metadata support
Diffstat (limited to 'tests/Hakyll')
-rw-r--r--tests/Hakyll/Core/Provider/GlobalMetadata/Tests.hs31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/Hakyll/Core/Provider/GlobalMetadata/Tests.hs b/tests/Hakyll/Core/Provider/GlobalMetadata/Tests.hs
new file mode 100644
index 0000000..289e2ac
--- /dev/null
+++ b/tests/Hakyll/Core/Provider/GlobalMetadata/Tests.hs
@@ -0,0 +1,31 @@
+--------------------------------------------------------------------------------
+{-# LANGUAGE OverloadedStrings #-}
+module Hakyll.Core.Provider.GlobalMetadata.Tests
+ ( tests
+ ) where
+
+--------------------------------------------------------------------------------
+import qualified Data.Map as M
+import Control.Monad (forM_)
+import Test.Framework (Test, testGroup)
+import Test.HUnit (Assertion, (@=?))
+
+
+--------------------------------------------------------------------------------
+import Hakyll.Core.Provider (resourceMetadata)
+import TestSuite.Util
+
+--------------------------------------------------------------------------------
+tests :: Test
+tests = testGroup "Hakyll.Core.Provider.GlobalMetadata.Tests" $
+ fromAssertions "page" [testPage]
+
+testPage :: Assertion
+testPage = do
+ store <- newTestStore
+ provider <- newTestProvider store
+
+ metadata <- resourceMetadata provider "posts/2013-10-18-metadata-test.md"
+ forM_ ["1", "2", "3", "4", "5", "6", "7", "8"] $ \a ->
+ Just a @=? M.lookup ('a':a) metadata
+