diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..8faf1aa --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.cabal linguist-generated diff --git a/cabal.project b/cabal.project index e1026e7..313a35c 100644 --- a/cabal.project +++ b/cabal.project @@ -3,3 +3,5 @@ packages: package hspec-expectations ghc-options: -Werror + +tests: True diff --git a/hspec-expectations.cabal b/hspec-expectations.cabal index f2e6f84..c9e3ea5 100644 --- a/hspec-expectations.cabal +++ b/hspec-expectations.cabal @@ -5,7 +5,7 @@ cabal-version: 1.12 -- see: https://github.com/sol/hpack name: hspec-expectations -version: 0.8.3 +version: 0.8.4 synopsis: Catchy combinators for HUnit description: Catchy combinators for HUnit: bug-reports: https://github.com/hspec/hspec-expectations/issues diff --git a/package.yaml b/package.yaml index 0f4aeff..9b879fd 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: hspec-expectations -version: 0.8.3 +version: 0.8.4 synopsis: Catchy combinators for HUnit description: "Catchy combinators for HUnit: " license: MIT diff --git a/src/Test/Hspec/Expectations.hs b/src/Test/Hspec/Expectations.hs index 64b5fe3..15059f0 100644 --- a/src/Test/Hspec/Expectations.hs +++ b/src/Test/Hspec/Expectations.hs @@ -171,9 +171,9 @@ action `shouldThrow` p = do "did not get expected exception: " ++ exceptionType Left e -> (`expectTrue` p e) $ - "predicate failed on expected exception: " ++ exceptionType ++ " (" ++ show e ++ ")" + "predicate failed on expected exception: " ++ exceptionType ++ "\n" ++ show e where - -- a string repsentation of the expected exception's type + -- a string representation of the expected exception's type exceptionType = (show . typeOf . instanceOf) p where instanceOf :: Selector a -> a diff --git a/test/Test/Hspec/ExpectationsSpec.hs b/test/Test/Hspec/ExpectationsSpec.hs index c2847d7..b4174e6 100644 --- a/test/Test/Hspec/ExpectationsSpec.hs +++ b/test/Test/Hspec/ExpectationsSpec.hs @@ -96,7 +96,7 @@ spec = do error "foobar" `shouldThrow` errorCall "foobar" it "fails, if a required specific exception is not thrown" $ do - (throwIO Overflow `shouldThrow` (== DivideByZero)) `shouldThrow` expectationFailed (Reason "predicate failed on expected exception: ArithException (arithmetic overflow)") + (throwIO Overflow `shouldThrow` (== DivideByZero)) `shouldThrow` expectationFailed (Reason "predicate failed on expected exception: ArithException\narithmetic overflow") it "fails, if any exception is required, but no exception is thrown" $ do (return () `shouldThrow` anyException) `shouldThrow` expectationFailed (Reason "did not get expected exception: SomeException")