conduit-extra 1.2.3 → 1.2.3.1
raw patch · 4 files changed
+36/−2 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- Data/Conduit/Process/Typed.hs +1/−1
- conduit-extra.cabal +2/−1
- test/Data/Conduit/Process/TypedSpec.hs +29/−0
ChangeLog.md view
@@ -1,3 +1,7 @@+## 1.2.3.1++* Fix typo in implementation of `withProcess_`+ ## 1.2.3 * Added `withLoggedProcess_`
Data/Conduit/Process/Typed.hs view
@@ -77,7 +77,7 @@ => ProcessConfig stdin stdout stderr -> (Process stdin stdout stderr -> m a) -> m a-withProcess_ pc f = withRunInIO $ \run -> P.withProcess pc (run . f)+withProcess_ pc f = withRunInIO $ \run -> P.withProcess_ pc (run . f) -- | Run a process, throwing an exception on a failure exit code. This -- will store all output from stdout and stderr in memory for better
conduit-extra.cabal view
@@ -1,5 +1,5 @@ Name: conduit-extra-Version: 1.2.3+Version: 1.2.3.1 Synopsis: Batteries included conduit: adapters for common libraries. Description: The conduit package itself maintains relative small dependencies. The purpose of this package is to collect commonly used utility functions wrapping other library dependencies, without depending on heavier-weight dependencies. The basic idea is that this package should only depend on haskell-platform packages and conduit.@@ -104,6 +104,7 @@ Data.Conduit.LazySpec Data.Conduit.NetworkSpec Data.Conduit.ProcessSpec+ Data.Conduit.Process.TypedSpec Data.Conduit.TextSpec Data.Conduit.ZlibSpec
+ test/Data/Conduit/Process/TypedSpec.hs view
@@ -0,0 +1,29 @@+module Data.Conduit.Process.TypedSpec (spec) where++import Test.Hspec+import Data.Conduit+import Data.Conduit.Process.Typed+import qualified Data.Conduit.List as CL+import qualified Data.ByteString as B++spec :: Spec+spec = do+ it "cat works" $ do+ let fp = "ChangeLog.md"+ pc = setStdout createSource $ proc "cat" [fp]+ bs <- B.readFile fp+ bss <- withProcess_ pc $ \p -> runConduit $ getStdout p .| CL.consume+ B.concat bss `shouldBe` bs+ it "cat works with withLoggedProcess_" $ do+ let fp = "ChangeLog.md"+ pc = proc "cat" [fp]+ bs <- B.readFile fp+ bss <- withLoggedProcess_ pc $ \p -> runConduit $ getStdout p .| CL.consume+ B.concat bss `shouldBe` bs+ it "failing process throws" $ do+ (withLoggedProcess_ (proc "cat" ["does not exist"]) $ \p -> do+ runConduit $ getStdout p .| CL.mapM_ (error "shouldn't have data"))+ `shouldThrow` anyException+ it "failing process throws" $ do+ (withProcess_ (proc "cat" ["does not exist"]) $ const $ return ())+ `shouldThrow` anyException