hspec 1.7.0 → 1.7.1
raw patch · 5 files changed
+17/−26 lines, 5 filesdep ~hspec-expectationsdep ~hspec-metaPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: hspec-expectations, hspec-meta
API changes (from Hackage documentation)
Files
- hspec.cabal +3/−8
- src/Test/Hspec/Formatters.hs +7/−7
- test/Helper.hs +0/−4
- test/Test/Hspec/FormattersSpec.hs +4/−4
- test/Test/Hspec/RunnerSpec.hs +3/−3
hspec.cabal view
@@ -1,5 +1,5 @@ name: hspec-version: 1.7.0+version: 1.7.1 license: MIT license-file: LICENSE copyright: (c) 2011-2013 Simon Hengel,@@ -62,7 +62,7 @@ , HUnit >= 1.2.5 , QuickCheck >= 2.5.1 , quickcheck-io- , hspec-expectations == 0.3.2.*+ , hspec-expectations == 0.3.3.* exposed-modules: Test.Hspec Test.Hspec.Core@@ -119,7 +119,7 @@ , quickcheck-io , hspec-expectations - , hspec-meta >= 1.5.1+ , hspec-meta >= 1.7.1 , process , ghc-paths @@ -186,7 +186,6 @@ , hspec-meta test-suite hspec-discover-example- buildable: False type: exitcode-stdio-1.0 ghc-options:@@ -201,7 +200,6 @@ , QuickCheck test-suite hspec-discover-integration-test-empty- buildable: False type: exitcode-stdio-1.0 ghc-options:@@ -215,7 +213,6 @@ , hspec test-suite hspec-discover-integration-test-with-formatter- buildable: False type: exitcode-stdio-1.0 ghc-options:@@ -229,7 +226,6 @@ , hspec test-suite hspec-discover-integration-test-with-io-formatter- buildable: False type: exitcode-stdio-1.0 ghc-options:@@ -244,7 +240,6 @@ , transformers test-suite hspec-discover-integration-test-with-formatter-empty- buildable: False type: exitcode-stdio-1.0 ghc-options:
src/Test/Hspec/Formatters.hs view
@@ -138,8 +138,8 @@ , exampleGroupDone = do newParagraph -, exampleProgress = \h _ (current, total) -> do- hPutStr h $ "(" ++ show current ++ "/" ++ show total ++ ")\r"+, exampleProgress = \h _ p -> do+ hPutStr h (formatProgress p) hFlush h , exampleSucceeded = \(nesting, requirement) -> withSuccessColor $ do@@ -157,6 +157,9 @@ , footerFormatter = defaultFooter } where indentationFor nesting = replicate (length nesting * 2) ' '+ formatProgress (current, total)+ | total == 0 = show current ++ "\r"+ | otherwise = show current ++ "/" ++ show total ++ "\r" progress :: Formatter@@ -191,15 +194,12 @@ formatFailure :: (Int, FailureRecord) -> FormatM () formatFailure (n, FailureRecord path reason) = do write (show n ++ ") ")+ writeLine (formatRequirement path) withFailColor $ do- write (formatRequirement path ++ " FAILED")- write $ case reason of- Right _ -> "\n"- Left _ -> " (uncaught exception)\n" unless (null err) $ do writeLine err where- err = either formatException id reason+ err = either (("uncaught exception: " ++) . formatException) id reason -- | Convert an exception to a string. --
test/Helper.hs view
@@ -14,7 +14,6 @@ , shouldStartWith , shouldEndWith-, shouldContain , shouldUseArgs ) where@@ -46,9 +45,6 @@ captureLines :: IO a -> IO [String] captureLines = fmap lines . capture_--shouldContain :: (Eq a, Show a) => [a] -> [a] -> Expectation-x `shouldContain` y = x `shouldSatisfy` isInfixOf y shouldStartWith :: (Eq a, Show a) => [a] -> [a] -> Expectation x `shouldStartWith` y = x `shouldSatisfy` isPrefixOf y
test/Test/Hspec/FormattersSpec.hs view
@@ -171,14 +171,14 @@ context "displays a detailed list of failures" $ do it "prints all requirements that are not met" $ do r <- runSpec testSpec- r `shouldSatisfy` any (== "1) Example fail 1 FAILED")+ r `shouldSatisfy` any (== "1) Example fail 1") it "prints the exception type for requirements that fail due to an uncaught exception" $ do r <- runSpec $ do H.it "foobar" (undefined :: Bool) r `shouldContain` [- "1) foobar FAILED (uncaught exception)"- , "ErrorCall (Prelude.undefined)"+ "1) foobar"+ , "uncaught exception: ErrorCall (Prelude.undefined)" ] it "prints all descriptions when a nested requirement fails" $ do@@ -186,7 +186,7 @@ H.describe "foo" $ do H.describe "bar" $ do H.it "baz" False- r `shouldSatisfy` any (== "1) foo.bar baz FAILED")+ r `shouldSatisfy` any (== "1) foo.bar baz") it "summarizes the number of examples and failures" $ do r <- runSpec testSpec
test/Test/Hspec/RunnerSpec.hs view
@@ -147,7 +147,7 @@ "" , "- foo FAILED [1]" , ""- , "1) foo FAILED"+ , "1) foo" , "" , "Randomized with seed 23" , ""@@ -203,7 +203,7 @@ , "- foo" , "- bar FAILED [1]" , ""- , "1) bar FAILED"+ , "1) bar" , "" , "Randomized with seed 23" , ""@@ -221,7 +221,7 @@ , "foo" , " - bar FAILED [1]" , ""- , "1) foo bar FAILED"+ , "1) foo bar" , "" , "Randomized with seed 23" , ""