-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Support functions for automated testing
--   
--   Support functions for automated testing
@package mockery
@version 0.3.5

module Test.Mockery.Directory

-- | Run given action with the current working directory set to a temporary
--   directory.
--   
--   The directory is created before the action is run. After the action
--   has completed the directory is removed and the current working
--   directory is restored to its original value.
inTempDirectory :: IO a -> IO a

-- | Similar to <a>inTempDirectory</a>, but the temporary directory will
--   have the specified name.
inTempDirectoryNamed :: FilePath -> IO a -> IO a

-- | Create a temporary file with the given contents and execute the given
--   action.
--   
--   The file is removed after the action has completed.
withFile :: String -> (FilePath -> IO a) -> IO a

-- | Update the modification time of the specified file. Create an empty
--   file (including any missing directories in the file path) if the file
--   does not exist.
touch :: FilePath -> IO ()

module Test.Mockery.Environment

-- | Run the given action within the specified environment.
--   
--   Before executing the action, <a>withEnvironment</a> backs up the
--   current environment, clears out the environment, and then applies the
--   supplied environment. After the action has completed the original
--   environment is restored.
--   
--   <b>Note</b>: The environment is global to a process, so tests that
--   modify the environment can no longer be run in parallel.
withEnvironment :: [(String, String)] -> IO a -> IO a

-- | Run the given action within an augmented environment.
--   
--   Before executing the action, <a>withModifiedEnvironment</a> backs up
--   the current environment and then augments it with the supplied values.
--   After the action has completed the original environment is restored.
--   
--   <b>Note</b>: The environment is global to a process, so tests that
--   modify the environment can no longer be run in parallel.
withModifiedEnvironment :: [(String, String)] -> IO a -> IO a

module Test.Mockery.Logging

-- | Capture all log messages produced by an IO action. Logs are kept in
--   memory.
captureLogMessages :: IO a -> IO ([(LogLevel, String)], a)

-- | Like <tt>captureLogsMessages</tt>, but ignores the result.
captureLogMessages_ :: IO a -> IO [(LogLevel, String)]
data () => LogLevel
TRACE :: LogLevel
DEBUG :: LogLevel
INFO :: LogLevel
WARN :: LogLevel
ERROR :: LogLevel
