mockery-0.1.0: Support functions for automated testing

Safe HaskellSafe-Inferred




inTempDirectory :: IO a -> IO a Source

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.

inTempDirectoryNamed :: FilePath -> IO a -> IO a Source

Similar to inTempDirectory, but the temporary directory will have the specified name.

withFile :: String -> (FilePath -> IO a) -> IO a Source

Create a temporary file with the given contents and execute the given action.

The file is removed after the action has completed.