test-sandbox 0.0.1.5 → 0.0.1.6
raw patch · 2 files changed
+5/−15 lines, 2 files
Files
- src/Test/Sandbox.hs +3/−13
- test-sandbox.cabal +2/−2
src/Test/Sandbox.hs view
@@ -60,7 +60,6 @@ , getFile , setFile , getDataDir- , bracket , checkVariable , getVariable , setVariable@@ -68,7 +67,9 @@ , withVariable -- * Sandbox exception handling+ , bracket , catchError+ , finally , throwError -- * Sandbox I/O handling@@ -76,7 +77,7 @@ ) where import Control.Concurrent (threadDelay)-import Control.Exception.Lifted hiding (bracket)+import Control.Exception.Lifted import Control.Monad import Control.Monad.Trans (liftIO) import Control.Monad.Trans.Error (runErrorT)@@ -274,17 +275,6 @@ case M.lookup name $ ssFiles env of Just file -> return file Nothing -> throwError $ "Config file " ++ name ++ " does not exist."---- | A variant of bracket from Control.Exception which works in the Sandbox monad.-bracket :: Sandbox a -- ^ Computation to run first ("acquire resource")- -> (a -> Sandbox b) -- ^ Computation to run last ("release resource")- -> (a -> Sandbox c) -- ^ Computation to run in-between- -> Sandbox c-bracket acquire release between = do- stuff <- acquire- result <- between stuff `catchError` (\e -> release stuff >> throwError e)- release stuff- return result -- | Temporarily sets a variable for the execution of the given action. withVariable :: (Serialize a)
test-sandbox.cabal view
@@ -1,5 +1,5 @@ Name: test-sandbox-Version: 0.0.1.5+Version: 0.0.1.6 Cabal-Version: >= 1.14 Category: Testing Synopsis: Sandbox for system tests@@ -25,7 +25,7 @@ Source-Repository this Type: git Location: https://github.com/gree/haskell-test-sandbox- Tag: test-sandbox_0.0.1.5+ Tag: test-sandbox_0.0.1.6 Library Exposed-modules: Test.Sandbox