packages feed

test-framework-sandbox 0.0.2.0 → 0.0.2.1

raw patch · 2 files changed

+10/−12 lines, 2 filesdep ~test-sandbox

Dependency ranges changed: test-sandbox

Files

src/Test/Framework/Providers/Sandbox.hs view
@@ -26,9 +26,9 @@ import Control.Concurrent import Control.Exception.Lifted import Control.Monad hiding (fail)-import Control.Monad.Trans (lift)+import Control.Monad.Reader (ask) import Control.Monad.Trans.Error (runErrorT)-import Control.Monad.Trans.State.Strict+import Control.Monad.Trans.Reader (runReaderT) import Data.Either import Prelude hiding (error, fail) import qualified Prelude (error)@@ -58,8 +58,8 @@                 buildTestBracketed $                   withSystemTempDirectory (name ++ "_") $ \dir -> do                     env <- newSandboxState name dir-                    (result, env') <- (runStateT . runErrorT . runSandbox) (putOptions options >> sandboxTestGroup name tests) env-                    let cleanup = (evalStateT . runErrorT . runSandbox) (silently stopAll) env'+                    result <- (runReaderT . runErrorT . runSandbox) (putOptions options >> sandboxTestGroup name tests) env+                    let cleanup = (runReaderT . runErrorT . runSandbox) (silently stopAll) env                                     >>= either putStrLn return                                     >> putMVar mvar 0                     case result of@@ -92,11 +92,9 @@             -> Sandbox ()   -- ^ Action to perform             -> Sandbox Test sandboxTest name test = withTest name $ do-  res <- Sandbox $ do-    env <- lift get-    (res, env') <- liftIO $ flip (runStateT . runErrorT . runSandbox) env $ test `catches` handlers-    lift $ put env'-    return res+  res <- do+    ref <- ask+    liftIO $ flip (runReaderT . runErrorT . runSandbox) ref $ test `catches` handlers   liftIO $ printTestResult res   case res of     Left error -> return $ Test name (SandboxTest (Failure error))
test-framework-sandbox.cabal view
@@ -1,5 +1,5 @@ Name:           test-framework-sandbox-Version:        0.0.2.0+Version:        0.0.2.1 Cabal-Version:  >= 1.14 Category:       Testing Synopsis:       test-sandbox support for the test-framework package@@ -29,14 +29,14 @@ Source-Repository this     Type:       git     Location:   https://github.com/gree/haskell-test-sandbox-    Tag:        test-framework-sandbox_0.0.2.0+    Tag:        test-framework-sandbox_0.0.2.1  Library     Exposed-modules:    Test.Framework.Providers.Sandbox                         Test.Framework.Providers.Sandbox.Internals      Build-Depends:      base >=4 && <5, ansi-terminal, lifted-base, mtl,-                        temporary, test-framework >= 0.8.0.3, test-sandbox == 0.0.1.*,+                        temporary, test-framework >=0.8.0.3, test-sandbox >=0.0.1.5 && <0.0.2,                         transformers      Hs-source-dirs:     src