From bbc2631c76db01e85ac5c4e75b1babb6c5b05697 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sun, 6 Jan 2013 18:33:00 +0100 Subject: Add TmpFile utilities --- tests/Hakyll/Web/Template/Context/Tests.hs | 5 ++++- tests/Hakyll/Web/Template/Tests.hs | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'tests/Hakyll/Web') diff --git a/tests/Hakyll/Web/Template/Context/Tests.hs b/tests/Hakyll/Web/Template/Context/Tests.hs index f2fb42a..5533c71 100644 --- a/tests/Hakyll/Web/Template/Context/Tests.hs +++ b/tests/Hakyll/Web/Template/Context/Tests.hs @@ -29,7 +29,8 @@ tests = testGroup "Hakyll.Core.Template.Context.Tests" -------------------------------------------------------------------------------- testDateField :: Assertion -testDateField = withTestStore $ \store -> do +testDateField = do + store <- newTestStore provider <- newTestProvider store date1 <- testContextDone store provider "example.md" "date" $ @@ -41,6 +42,8 @@ testDateField = withTestStore $ \store -> do dateField "date" "%B %e, %Y" date2 @=? "August 26, 2010" + cleanTestEnv + -------------------------------------------------------------------------------- testContextDone :: Store -> Provider -> Identifier -> String diff --git a/tests/Hakyll/Web/Template/Tests.hs b/tests/Hakyll/Web/Template/Tests.hs index 6c5c77a..fce5503 100644 --- a/tests/Hakyll/Web/Template/Tests.hs +++ b/tests/Hakyll/Web/Template/Tests.hs @@ -30,11 +30,13 @@ tests = testGroup "Hakyll.Core.Template.Tests" -------------------------------------------------------------------------------- case01 :: Assertion -case01 = withTestStore $ \store -> do +case01 = do + store <- newTestStore provider <- newTestProvider store out <- resourceString provider "template.html.out" - tpl <- testCompilerDone store provider "template.html" $ templateCompiler + tpl <- testCompilerDone store provider "template.html" $ + templateCompiler item <- testCompilerDone store provider "example.md" $ pandocCompiler >>= applyTemplate (itemBody tpl) testContext -- cgit v1.2.3