summaryrefslogtreecommitdiff
path: root/tests/Hakyll
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2012-02-06 12:45:03 +0100
committerJasper Van der Jeugt <m@jaspervdj.be>2012-02-06 12:45:03 +0100
commit96e8736655f18b79fcdcbad5cda8e11bb2827ac8 (patch)
tree56320b3d342537fd03ec0fbfad1b007bae8688a8 /tests/Hakyll
parenta66eba49b6ab6179bfb396b56d35610db4cffd7e (diff)
downloadhakyll-96e8736655f18b79fcdcbad5cda8e11bb2827ac8.tar.gz
Add renderDateField/comparePagesByDate tests
See #53
Diffstat (limited to 'tests/Hakyll')
-rw-r--r--tests/Hakyll/Web/Page/Metadata/Tests.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/Hakyll/Web/Page/Metadata/Tests.hs b/tests/Hakyll/Web/Page/Metadata/Tests.hs
index f14bfec..e3ceed9 100644
--- a/tests/Hakyll/Web/Page/Metadata/Tests.hs
+++ b/tests/Hakyll/Web/Page/Metadata/Tests.hs
@@ -49,6 +49,11 @@ tests = concat $
, (@=?) "Date unknown" $ getField "date" $ renderDateField
"date" "%B %e, %Y" "Date unknown" $ Page
(M.singleton "path" "/posts/a-post.mkdwn") ""
+ , (@=?) "February 20, 2000" $ getField "date" $ renderDateField
+ "date" "%B %e, %Y" "Date unknown" $ flip Page "" $ M.fromList
+ [ ("path", "/posts/2010-01-31-a-post.mkdwn")
+ , ("published", "February 20, 2000 1:00 PM")
+ ]
]
, fromAssertions "copyBodyToField"
@@ -60,4 +65,10 @@ tests = concat $
[ (Page (M.singleton "bar" "foo") "foo") @=?
copyBodyFromField "bar" (Page (M.singleton "bar" "foo") "qux")
]
+
+ , fromAssertions "comparePagesByDate"
+ [ GT @=? comparePagesByDate
+ (Page (M.singleton "path" "/posts/1990-08-26-foo.mkdwn") "")
+ (Page (M.singleton "path" "/posts/1990-06-18-qux.mkdwn") "")
+ ]
]