@@ -13,6 +13,7 @@ import Test.HUnit (Assertion, (@=?), (@?=))
14--------------------------------------------------------------------------------
14--------------------------------------------------------------------------------
15import Hakyll.Core.Compiler
15import Hakyll.Core.Compiler
16+import Hakyll.Core.Identifier
16import Hakyll.Core.Item
17import Hakyll.Core.Item
17import Hakyll.Core.Provider
18import Hakyll.Core.Provider
18import Hakyll.Web.Pandoc
19import Hakyll.Web.Pandoc
@@ -26,7 +27,8 @@ import TestSuite.Util
26--------------------------------------------------------------------------------
27--------------------------------------------------------------------------------
27tests :: Test
28tests :: Test
28tests = testGroup "Hakyll.Core.Template.Tests" $ concat
29tests = testGroup "Hakyll.Core.Template.Tests" $ concat
29− [ [ testCase "case01" case01
30+ [ [ testCase "case01" $ test ("template.html.out", "template.html", "example.md")
31+ , testCase "case02" $ test ("strip.html.out", "strip.html", "example.md")
30 , testCase "applyJoinTemplateList" testApplyJoinTemplateList
32 , testCase "applyJoinTemplateList" testApplyJoinTemplateList
@@ -78,14 +80,14 @@ tests = testGroup "Hakyll.Core.Template.Tests" $ concat
80--------------------------------------------------------------------------------
82--------------------------------------------------------------------------------
81−case01 :: Assertion
83+test :: (Identifier, Identifier, Identifier) -> Assertion
82−case01 = do
84+test (outf, tplf, itemf) = do
83 store <- newTestStore
85 store <- newTestStore
84 provider <- newTestProvider store
86 provider <- newTestProvider store
86− out <- resourceString provider "template.html.out"
88+ out <- resourceString provider outf
87− tpl <- testCompilerDone store provider "template.html" templateBodyCompiler
89+ tpl <- testCompilerDone store provider tplf templateBodyCompiler
88− item <- testCompilerDone store provider "example.md" $
90+ item <- testCompilerDone store provider itemf $
89 pandocCompiler >>= applyTemplate (itemBody tpl) testContext
91 pandocCompiler >>= applyTemplate (itemBody tpl) testContext
91 out @=? itemBody item
93 out @=? itemBody item