summaryrefslogtreecommitdiff
path: root/tests/Hakyll/Core/Runtime
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2016-08-04 14:13:24 +0200
committerJasper Van der Jeugt <m@jaspervdj.be>2016-08-04 14:13:24 +0200
commitfdb298d6a22dbab32d5da6c653b600d1b8f93143 (patch)
treec7f335d08d00bf02e01e139102f0c0458f07682a /tests/Hakyll/Core/Runtime
parent82ba9542e75238f4b69d1a497d429962cdff1e14 (diff)
downloadhakyll-fdb298d6a22dbab32d5da6c653b600d1b8f93143.tar.gz
Fix partials and add a test
Fixes #460
Diffstat (limited to 'tests/Hakyll/Core/Runtime')
-rw-r--r--tests/Hakyll/Core/Runtime/Tests.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/Hakyll/Core/Runtime/Tests.hs b/tests/Hakyll/Core/Runtime/Tests.hs
index 1ef77ca..1bdfc60 100644
--- a/tests/Hakyll/Core/Runtime/Tests.hs
+++ b/tests/Hakyll/Core/Runtime/Tests.hs
@@ -41,6 +41,15 @@ case01 = do
>>= saveSnapshot "raw"
>>= renderPandoc
+ match (fromList ["partial.html", "partial-helper.html"]) $
+ compile templateCompiler
+ create ["partial.html.out"] $ do
+ route idRoute
+ compile $ do
+ example <- loadSnapshotBody "example.md" "raw"
+ makeItem example
+ >>= loadAndApplyTemplate "partial.html" defaultContext
+
create ["bodies.txt"] $ do
route idRoute
compile $ do
@@ -60,6 +69,10 @@ case01 = do
bodies <- readFile $ destinationDirectory testConfiguration </> "bodies.txt"
head (lines bodies) @?= "This is an example."
+ partial <- readFile $ providerDirectory testConfiguration </> "partial.html.out"
+ partial' <- readFile $ destinationDirectory testConfiguration </> "partial.html.out"
+ partial @?= partial'
+
cleanTestEnv