on master help sign in
Add test case to confirm #117
ca49489Jasper Van der Jeugt
tests/Hakyll/Core/Runtime/Tests.hs+11
@@ -6,6 +6,7 @@ module Hakyll.Core.Runtime.Tests
6
6
7
7
8--------------------------------------------------------------------------------
8--------------------------------------------------------------------------------
9+import qualified Data.ByteString as B
9import System.FilePath ((</>))
10import System.FilePath ((</>))
10import Test.Framework (Test, testGroup)
11import Test.Framework (Test, testGroup)
11import Test.HUnit (Assertion, (@?=))
12import Test.HUnit (Assertion, (@?=))
@@ -28,6 +29,10 @@ tests = testGroup "Hakyll.Core.Runtime.Tests" $
28case01 :: Assertion
29case01 :: Assertion
29case01 = do
30case01 = do
30 _ <- run testConfiguration Logger.Error $ do
31 _ <- run testConfiguration Logger.Error $ do
32+ match "images/*" $ do
33+ route idRoute
34+ compile copyFileCompiler
35+
31 match "*.md" $ do
36 match "*.md" $ do
32 route $ setExtension "html"
37 route $ setExtension "html"
33 compile $ do
38 compile $ do
@@ -41,6 +46,12 @@ case01 = do
41 items <- loadAllSnapshots "*.md" "raw"
46 items <- loadAllSnapshots "*.md" "raw"
42 makeItem $ concat $ map itemBody (items :: [Item String])
47 makeItem $ concat $ map itemBody (items :: [Item String])
43
48
49+ favicon <- B.readFile $
50+ providerDirectory testConfiguration </> "images/favicon.ico"
51+ favicon' <- B.readFile $
52+ destinationDirectory testConfiguration </> "images/favicon.ico"
53+ favicon @?= favicon'
54+
44 example <- readFile $
55 example <- readFile $
45 destinationDirectory testConfiguration </> "example.html"
56 destinationDirectory testConfiguration </> "example.html"
46 lines example @?= ["<p>This is an example.</p>"]
57 lines example @?= ["<p>This is an example.</p>"]