diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-11-21 20:38:13 +0100 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2012-11-21 20:38:13 +0100 |
commit | c32e57262b1c4544c323ea04c21608aef1126765 (patch) | |
tree | aa9a2375586a30014d617bf5836faceda699f03e /tests/TestSuite | |
parent | 6b4c65642e21684bc143eaf29453d1d99fd9e227 (diff) | |
download | hakyll-c32e57262b1c4544c323ea04c21608aef1126765.tar.gz |
Add a runtime test
Diffstat (limited to 'tests/TestSuite')
-rw-r--r-- | tests/TestSuite/Util.hs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/TestSuite/Util.hs b/tests/TestSuite/Util.hs index 5d62ffc..8f0911d 100644 --- a/tests/TestSuite/Util.hs +++ b/tests/TestSuite/Util.hs @@ -8,6 +8,7 @@ module TestSuite.Util , newTestProvider , testCompiler , testCompilerDone + , withTestConfiguration ) where @@ -22,6 +23,7 @@ import Text.Printf (printf) -------------------------------------------------------------------------------- import Hakyll.Core.Compiler.Internal +import Hakyll.Core.Configuration import Hakyll.Core.Identifier import qualified Hakyll.Core.Logger as Logger import Hakyll.Core.Provider @@ -92,3 +94,19 @@ testCompilerDone store provider underlying compiler = do CompilerRequire i _ -> error $ "TestSuite.Util.testCompilerDone: compiler " ++ show underlying ++ " requires: " ++ show i + + + +-------------------------------------------------------------------------------- +withTestConfiguration :: (Configuration -> IO a) -> IO a +withTestConfiguration f = do + x <- f config + removeDirectoryRecursive $ destinationDirectory config + removeDirectoryRecursive $ storeDirectory config + return x + where + config = defaultConfiguration + { destinationDirectory = "_testsite" + , storeDirectory = "_teststore" + , providerDirectory = "tests/data" + } |