From 802742cdbed1bb0afa022e072621e621d21158f6 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Mon, 19 Nov 2012 15:12:53 +0100 Subject: Remove hamlet, add function fields --- tests/Hakyll/Web/Template/Tests.hs | 13 +++++++++++-- tests/data/example.md.out | 3 --- tests/data/template.html | 1 + tests/data/template.html.out | 4 ++++ 4 files changed, 16 insertions(+), 5 deletions(-) delete mode 100644 tests/data/example.md.out create mode 100644 tests/data/template.html.out (limited to 'tests') diff --git a/tests/Hakyll/Web/Template/Tests.hs b/tests/Hakyll/Web/Template/Tests.hs index 42be506..4e49d1f 100644 --- a/tests/Hakyll/Web/Template/Tests.hs +++ b/tests/Hakyll/Web/Template/Tests.hs @@ -6,6 +6,7 @@ module Hakyll.Web.Template.Tests -------------------------------------------------------------------------------- +import Data.Monoid (mconcat) import Test.Framework (Test, testGroup) import Test.Framework.Providers.HUnit (testCase) import Test.HUnit (Assertion, (@=?)) @@ -32,9 +33,17 @@ case01 :: Assertion case01 = withTestStore $ \store -> do provider <- newTestProvider store - out <- resourceString provider "example.md.out" + out <- resourceString provider "template.html.out" tpl <- testCompilerDone store provider "template.html" $ templateCompiler item <- testCompilerDone store provider "example.md" $ - pageCompiler >>= applyTemplate (itemBody tpl) defaultContext + pageCompiler >>= applyTemplate (itemBody tpl) testContext out @=? itemBody item + + +-------------------------------------------------------------------------------- +testContext :: Context String +testContext = mconcat + [ functionField "echo" (\args _ -> return $ unwords args) + , defaultContext + ] diff --git a/tests/data/example.md.out b/tests/data/example.md.out deleted file mode 100644 index f2c4c28..0000000 --- a/tests/data/example.md.out +++ /dev/null @@ -1,3 +0,0 @@ -
-

This is an example.

-
diff --git a/tests/data/template.html b/tests/data/template.html index 8fa47e4..52189a3 100644 --- a/tests/data/template.html +++ b/tests/data/template.html @@ -1,3 +1,4 @@
+ $echo test$ $body$
diff --git a/tests/data/template.html.out b/tests/data/template.html.out new file mode 100644 index 0000000..51a105e --- /dev/null +++ b/tests/data/template.html.out @@ -0,0 +1,4 @@ +
+ test +

This is an example.

+
-- cgit v1.2.3