From c32e57262b1c4544c323ea04c21608aef1126765 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Wed, 21 Nov 2012 20:38:13 +0100 Subject: Add a runtime test --- tests/Hakyll/Core/Runtime/Tests.hs | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tests/Hakyll/Core/Runtime/Tests.hs (limited to 'tests/Hakyll/Core') diff --git a/tests/Hakyll/Core/Runtime/Tests.hs b/tests/Hakyll/Core/Runtime/Tests.hs new file mode 100644 index 0000000..bb39a5f --- /dev/null +++ b/tests/Hakyll/Core/Runtime/Tests.hs @@ -0,0 +1,37 @@ +-------------------------------------------------------------------------------- +{-# LANGUAGE OverloadedStrings #-} +module Hakyll.Core.Runtime.Tests + ( tests + ) where + + +-------------------------------------------------------------------------------- +import System.FilePath (()) +import Test.Framework (Test, testGroup) +import Test.HUnit (Assertion, (@?=)) + + +-------------------------------------------------------------------------------- +import Hakyll.Core.Configuration +import Hakyll.Core.Routes +import Hakyll.Core.Rules +import Hakyll.Core.Runtime +import Hakyll.Web.Page +import TestSuite.Util + + +-------------------------------------------------------------------------------- +tests :: Test +tests = testGroup "Hakyll.Core.Runtime.Tests" $ fromAssertions "run" [case01] + + +-------------------------------------------------------------------------------- +case01 :: Assertion +case01 = withTestConfiguration $ \config -> do + _ <- run config $ do + match "*.md" $ do + route $ setExtension "html" + compile $ pageCompiler + + out <- readFile $ destinationDirectory config "example.html" + lines out @?= ["

This is an example.

"] -- cgit v1.2.3