silently 1.2 → 1.2.0.1
raw patch · 2 files changed
+1/−30 lines, 2 filesnew-uploader
Files
- silently.cabal +1/−1
- test/Spec.hs +0/−29
silently.cabal view
@@ -1,5 +1,5 @@ name: silently-version: 1.2+version: 1.2.0.1 cabal-version: >= 1.8 build-type: Simple license: BSD3
− test/Spec.hs
@@ -1,29 +0,0 @@-module Main (main) where--import Test.Hspec.ShouldBe--import System.IO-import System.IO.Silently-import System.Directory--import Control.Exception--main :: IO ()-main = hspec spec--spec :: Spec-spec = do-- describe "hSilence" $ do- it "prevents output to a given handle" $ let file = "test/foo.txt" in do- h <- openFile file ReadWriteMode- hSilence [h] $ do- hPutStrLn h "foo bar baz"- hFlush h- hSeek h AbsoluteSeek 0- hGetContents h `shouldReturn` ""- `finally` removeFile file-- describe "capture" $ do- it "captures stdout" $ do- capture (putStr "foo" >> return 23) `shouldReturn` ("foo", 23 :: Int)