diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-01-31 15:27:03 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-01-31 15:27:03 +0100 |
commit | d7e9b2f2d71231ecbe761e57ca0023bd266fa566 (patch) | |
tree | 17bbab5048f0aafdd99bbbcd8b29a534870e2a3b | |
parent | d1c0ad7c25427980bee482db31678f9ac4958c1c (diff) | |
download | hakyll-d7e9b2f2d71231ecbe761e57ca0023bd266fa566.tar.gz |
Add a test for renderDateField
-rw-r--r-- | src/Hakyll/Web/Feed.hs | 6 | ||||
-rw-r--r-- | tests/Hakyll/Web/Page/Metadata/Tests.hs | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/Hakyll/Web/Feed.hs b/src/Hakyll/Web/Feed.hs index 77c97d3..f64bb55 100644 --- a/src/Hakyll/Web/Feed.hs +++ b/src/Hakyll/Web/Feed.hs @@ -7,11 +7,11 @@ -- Also note that the pages should have (at least) the following fields to -- produce a correct feed: -- --- - @$title@: Title of the item +-- - @$title$@: Title of the item -- --- - @$description@: Description to appear in the feed +-- - @$description$@: Description to appear in the feed -- --- - @$url@: URL to the item - this is usually set automatically. +-- - @$url$@: URL to the item - this is usually set automatically. -- -- In addition, the posts should be named according to the rules for -- 'Hakyll.Page.Metadata.renderDateField'. diff --git a/tests/Hakyll/Web/Page/Metadata/Tests.hs b/tests/Hakyll/Web/Page/Metadata/Tests.hs index 6fbd89a..f14bfec 100644 --- a/tests/Hakyll/Web/Page/Metadata/Tests.hs +++ b/tests/Hakyll/Web/Page/Metadata/Tests.hs @@ -42,6 +42,15 @@ tests = concat $ setFieldA "bar" (map toLower) (mempty, "FOO") ] + , fromAssertions "renderDateField" + [ (@=?) "January 31, 2010" $ getField "date" $ renderDateField + "date" "%B %e, %Y" "Date unknown" $ Page + (M.singleton "path" "/posts/2010-01-31-a-post.mkdwn") "" + , (@=?) "Date unknown" $ getField "date" $ renderDateField + "date" "%B %e, %Y" "Date unknown" $ Page + (M.singleton "path" "/posts/a-post.mkdwn") "" + ] + , fromAssertions "copyBodyToField" [ (Page (M.singleton "bar" "foo") "foo") @=? copyBodyToField "bar" (Page M.empty "foo") |