packages feed

hspec-core 2.0.2 → 2.1.0

raw patch · 3 files changed

+7/−31 lines, 3 filesdep −ghc-pathsnew-uploader

Dependencies removed: ghc-paths

Files

hspec-core.cabal view
@@ -1,5 +1,5 @@ name:             hspec-core-version:          2.0.2+version:          2.1.0 license:          MIT license-file:     LICENSE copyright:        (c) 2011-2014 Simon Hengel,@@ -102,5 +102,4 @@     , hspec-meta >= 1.12     , silently >= 1.2.4     , process-    , ghc-paths   default-language: Haskell2010
src/Test/Hspec/Core/Hooks.hs view
@@ -44,8 +44,8 @@ after action = aroundWith $ \e x -> e x `finally` action x  -- | Run a custom action after every spec item.-after_ :: IO () -> Spec -> Spec-after_ action = after $ \() -> action+after_ :: IO () -> SpecWith a -> SpecWith a+after_ action = after $ \_ -> action  -- | Run a custom action before and/or after every spec item. around :: (ActionWith a -> IO ()) -> SpecWith a -> Spec@@ -56,12 +56,12 @@ afterAll action spec = runIO (runSpecM spec) >>= fromSpecList . return . NodeWithCleanup action  -- | Run a custom action after the last spec item.-afterAll_ :: IO () -> Spec -> Spec-afterAll_ action = afterAll (\() -> action)+afterAll_ :: IO () -> SpecWith a -> SpecWith a+afterAll_ action = afterAll (\_ -> action)  -- | Run a custom action before and/or after every spec item.-around_ :: (IO () -> IO ()) -> Spec -> Spec-around_ action = around $ action . ($ ())+around_ :: (IO () -> IO ()) -> SpecWith a -> SpecWith a+around_ action = aroundWith $ \e a -> action (e a)  -- | Run a custom action before and/or after every spec item. aroundWith :: (ActionWith a -> ActionWith b) -> SpecWith a -> SpecWith b
test/Test/Hspec/FailureReportSpec.hs view
@@ -4,9 +4,6 @@  import           System.IO import           Test.Hspec.FailureReport-import           GHC.Paths (ghc)-import           System.Process-import           System.Exit  main :: IO () main = hspec spec@@ -17,23 +14,3 @@     it "prints a warning on unexpected exceptions" $ do       r <- hCapture_ [stderr] $ writeFailureReport (error "some error")       r `shouldBe` "WARNING: Could not write environment variable HSPEC_FAILURES (some error)\n"--  -- GHCi needs to keep the environment on :reload, so that we can store-  -- failures there.  Otherwise --rerun would not be very useful.  So we add a-  -- test for that.-  describe "GHCi" $ do-    it "keeps environment variables on :reload" $ do-      let flags = ["-v0", "--interactive", "-ignore-dot-ghci"]-      (Just hIn, Just hOut, Nothing, processHandle) <- createProcess $ (proc ghc flags) {-          std_in = CreatePipe-        , std_out = CreatePipe-        }-      hPutStrLn hIn "import System.SetEnv"-      hPutStrLn hIn "setEnv \"FOO\" \"bar\""-      hPutStrLn hIn ":reload"-      hPutStrLn hIn "import System.Environment"-      hPutStrLn hIn "getEnv \"FOO\""-      hClose hIn-      r <- hGetContents hOut-      length r `seq` r `shouldBe` "\"bar\"\n"-      waitForProcess processHandle `shouldReturn` ExitSuccess