diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2013-02-16 12:59:38 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2013-02-16 12:59:38 +0100 |
commit | 1c2804287a099b4ac2f6c2d9b3db452f7ef7bee1 (patch) | |
tree | d5069a5124c734fb105f50821c357652e5e9dd61 /tests/Hakyll/Core/Runtime/Tests.hs | |
parent | 02a92d54cdee8299aac0f55cbe4a930ac5060d20 (diff) | |
download | hakyll-1c2804287a099b4ac2f6c2d9b3db452f7ef7bee1.tar.gz |
Add a test for compiler/route ordering
Diffstat (limited to 'tests/Hakyll/Core/Runtime/Tests.hs')
-rw-r--r-- | tests/Hakyll/Core/Runtime/Tests.hs | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/Hakyll/Core/Runtime/Tests.hs b/tests/Hakyll/Core/Runtime/Tests.hs index c68d99e..8a05824 100644 --- a/tests/Hakyll/Core/Runtime/Tests.hs +++ b/tests/Hakyll/Core/Runtime/Tests.hs @@ -20,7 +20,8 @@ import TestSuite.Util -------------------------------------------------------------------------------- tests :: Test -tests = testGroup "Hakyll.Core.Runtime.Tests" $ fromAssertions "run" [case01] +tests = testGroup "Hakyll.Core.Runtime.Tests" $ + fromAssertions "run" [case01, case02] -------------------------------------------------------------------------------- @@ -48,3 +49,22 @@ case01 = do head (lines bodies) @?= "This is an example." cleanTestEnv + + +-------------------------------------------------------------------------------- +case02 :: Assertion +case02 = do + _ <- run testConfiguration Logger.Error $ do + match "images/favicon.ico" $ do + route $ gsubRoute "images/" (const "") + compile $ makeItem ("Test" :: String) + + match "images/**" $ do + route idRoute + compile copyFileCompiler + + favicon <- readFile $ + destinationDirectory testConfiguration </> "favicon.ico" + favicon @?= "Test" + + cleanTestEnv |