on master help sign in
Bump hamlet dependency

Closes #81

commit3751d0a7ad5feea6a7c79d2e041c250a1d0a356f authorJasper Van der Jeugt <m@jaspervdj.be> dateFri 10 Aug 2012, 09:38 (14 years ago) parentedfdb7d
2 files changed+11−10
hakyll.cabal+2−2 tests/Hakyll/Web/Template/Tests.hs+9−8
hakyll.cabal+2−2
@@ -74,7 +74,7 @@ Library
7474 cryptohash >= 0.7 && < 0.8,
7575 directory >= 1.0 && < 1.2,
7676 filepath >= 1.0 && < 1.4,
77− hamlet >= 1.0 && < 1.1,
77+ hamlet >= 1.0 && < 1.2,
7878 mtl >= 1 && < 2.2,
7979 old-locale >= 1.0 && < 1.1,
8080 old-time >= 1.0 && < 1.2,
@@ -182,7 +182,7 @@ Test-suite hakyll-tests
182182 cryptohash >= 0.7 && < 0.8,
183183 directory >= 1.0 && < 1.2,
184184 filepath >= 1.0 && < 1.4,
185− hamlet >= 1.0 && < 1.1,
185+ hamlet >= 1.0 && < 1.2,
186186 mtl >= 1 && < 2.2,
187187 old-locale >= 1.0 && < 1.1,
188188 old-time >= 1.0 && < 1.2,
tests/Hakyll/Web/Template/Tests.hs+9−8
@@ -17,17 +17,18 @@ tests :: [Test]
1717tests = fromAssertions "applyTemplate"
1818 -- Hakyll templates
1919 [ applyTemplateAssertion readTemplate applyTemplate
20− "bar" "$foo$" [("foo", "bar")]
20+ ("bar" @=?) "$foo$" [("foo", "bar")]
2121
2222 , applyTemplateAssertion readTemplate applyTemplate
23− "$ barqux" "$$ $foo$$bar$" [("foo", "bar"), ("bar", "qux")]
23+ ("$ barqux" @=?) "$$ $foo$$bar$" [("foo", "bar"), ("bar", "qux")]
2424
2525 , applyTemplateAssertion readTemplate applyTemplate
26− "$foo$" "$foo$" []
26+ ("$foo$" @=?) "$foo$" []
2727
2828 -- Hamlet templates
2929 , applyTemplateAssertion readHamletTemplate applyTemplate
30− "<head><title>notice</title></head><body>A paragraph</body>"
30+ (("<head><title>notice</title></head><body>A paragraph</body>" @=?) .
31+ filter (/= '\n'))
3132 "<head>\n\
3233 \ <title>#{title}\n\
3334 \<body>\n\
@@ -39,16 +40,16 @@ tests = fromAssertions "applyTemplate"
3940 missing "bar" = "qux"
4041 missing x = reverse x
4142 in applyTemplateAssertion readTemplate (applyTemplateWith missing)
42− "bar foo ver" "$foo$ $bar$ $rev$" [("bar", "foo")]
43+ ("bar foo ver" @=?) "$foo$ $bar$ $rev$" [("bar", "foo")]
4344 ]
4445
4546-- | Utility function to create quick template tests
4647--
4748applyTemplateAssertion :: (String -> Template)
4849 -> (Template -> Page String -> Page String)
49− -> String
50+ -> (String -> Assertion)
5051 -> String
5152 -> [(String, String)]
5253 -> Assertion
53−applyTemplateAssertion parser apply expected template page =
54− expected @=? pageBody (apply (parser template) (fromMap $ M.fromList page))
54+applyTemplateAssertion parser apply correct template page =
55+ correct $ pageBody (apply (parser template) (fromMap $ M.fromList page))