summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGabriel Aumala <gabrielfima@live.com>2018-09-30 14:38:57 -0500
committerJasper Van der Jeugt <jaspervdj@gmail.com>2018-10-02 11:05:52 -0400
commitc85198d8cb6ce055c788e287c7f2470eac0aad36 (patch)
tree082fdd0e820e33ee66f8936206467a9151eaa885 /tests
parentda52a2aabfdbc83693574b192ed75c252d12b972 (diff)
downloadhakyll-c85198d8cb6ce055c788e287c7f2470eac0aad36.tar.gz
Drop extension when parsing dates in filepaths
Drop the file extension when parsing the date from the filepath of a resource.
Diffstat (limited to 'tests')
-rw-r--r--tests/Hakyll/Web/Template/Context/Tests.hs4
-rw-r--r--tests/data/posts/2018-09-26.md1
2 files changed, 5 insertions, 0 deletions
diff --git a/tests/Hakyll/Web/Template/Context/Tests.hs b/tests/Hakyll/Web/Template/Context/Tests.hs
index f263391..d4a9035 100644
--- a/tests/Hakyll/Web/Template/Context/Tests.hs
+++ b/tests/Hakyll/Web/Template/Context/Tests.hs
@@ -41,6 +41,10 @@ testDateField = do
dateField "date" "%B %e, %Y"
date2 @=? "August 26, 2010"
+ date3 <- testContextDone store provider
+ "posts/2018-09-26.md" "date" $
+ dateField "date" "%B %e, %Y"
+ date3 @=? "September 26, 2018"
cleanTestEnv
diff --git a/tests/data/posts/2018-09-26.md b/tests/data/posts/2018-09-26.md
new file mode 100644
index 0000000..038229a
--- /dev/null
+++ b/tests/data/posts/2018-09-26.md
@@ -0,0 +1 @@
+Something happened today.