hspec-core 2.5.3 → 2.5.4
raw patch · 5 files changed
+22/−4 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Test.Hspec.Core.Util: joinPath :: Path -> String
Files
- hspec-core.cabal +2/−2
- src/Test/Hspec/Core/Formatters.hs +3/−0
- src/Test/Hspec/Core/Util.hs +9/−2
- test/Test/Hspec/Core/FormattersSpec.hs +2/−0
- test/Test/Hspec/Core/RunnerSpec.hs +6/−0
hspec-core.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: c6552ddea76009fa34e130109e1d7e036f4790640cc908c42633598692cc0c24+-- hash: b098678af5a5999ea28d6152362006a70a50ebdcf343ec6707a508e3153a7cc2 name: hspec-core-version: 2.5.3+version: 2.5.4 license: MIT license-file: LICENSE copyright: (c) 2011-2018 Simon Hengel,
src/Test/Hspec/Core/Formatters.hs view
@@ -230,6 +230,9 @@ (xs, "") -> output xs (xs, _ : ys) -> output (xs ++ "\n") >> write (indentation ++ " ") >> indented output ys Error _ e -> withFailColor . indent $ (("uncaught exception: " ++) . formatException) e++ writeLine ""+ writeLine (" To rerun use: --match " ++ show (joinPath path)) where indentation = " " indent message = do
src/Test/Hspec/Core/Util.hs view
@@ -7,6 +7,7 @@ -- * Working with paths , Path+, joinPath , formatRequirement , filterPredicate @@ -68,6 +69,12 @@ type Path = ([String], String) -- |+-- Join a `Path` with slashes. The result will have a leading and a trailing+-- slash.+joinPath :: Path -> String+joinPath (groups, requirement) = "/" ++ intercalate "/" (groups ++ [requirement]) ++ "/"++-- | -- Try to create a proper English sentence from a path by applying some -- heuristics. formatRequirement :: Path -> String@@ -83,11 +90,11 @@ -- | A predicate that can be used to filter a spec tree. filterPredicate :: String -> Path -> Bool-filterPredicate pattern path@(groups, requirement) =+filterPredicate pattern path = pattern `isInfixOf` plain || pattern `isInfixOf` formatted where- plain = "/" ++ intercalate "/" (groups ++ [requirement]) ++ "/"+ plain = joinPath path formatted = formatRequirement path -- | The function `formatException` converts an exception to a string.
test/Test/Hspec/Core/FormattersSpec.hs view
@@ -217,6 +217,8 @@ , " two" , " third" , ""+ , " To rerun use: --match \"//\""+ , "" #if __GLASGOW_HASKELL__ == 800 , "WARNING:" , " Your version of GHC is affected by https://ghc.haskell.org/trac/ghc/ticket/13285."
test/Test/Hspec/Core/RunnerSpec.hs view
@@ -199,6 +199,8 @@ , "" , " 1) foo" , ""+ , " To rerun use: --match \"/foo/\""+ , "" #if __GLASGOW_HASKELL__ == 800 , "WARNING:" , " Your version of GHC is affected by https://ghc.haskell.org/trac/ghc/ticket/13285."@@ -268,6 +270,8 @@ , "" , " 1) bar" , ""+ , " To rerun use: --match \"/bar/\""+ , "" #if __GLASGOW_HASKELL__ == 800 , "WARNING:" , " Your version of GHC is affected by https://ghc.haskell.org/trac/ghc/ticket/13285."@@ -313,6 +317,8 @@ , "Failures:" , "" , " 1) foo bar"+ , ""+ , " To rerun use: --match \"/foo/bar/\"" , "" #if __GLASGOW_HASKELL__ == 800 , "WARNING:"