hspec 1.1.1 → 1.1.2
raw patch · 3 files changed
+18/−12 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Test.Hspec.Monadic: context :: String -> Spec -> Spec
Files
- Test/Hspec/Monadic.hs +1/−3
- Test/Hspec/Runner.hs +16/−8
- hspec.cabal +1/−1
Test/Hspec/Monadic.hs view
@@ -16,7 +16,7 @@ -- * Defining a spec , describe--- , context+, context , it , pending @@ -152,10 +152,8 @@ describe :: String -> Spec -> Spec describe label action = SpecM . tell $ [Core.describe label (runSpecM action)] -{- context :: String -> Spec -> Spec context = describe--} it :: Example v => String -> v -> Spec it label action = (SpecM . tell) [Core.it label action]
Test/Hspec/Runner.hs view
@@ -15,13 +15,13 @@ -- | Evaluate and print the result of checking the spec examples. runFormatter :: Formatter -> Spec -> FormatM EvaluatedSpec-runFormatter formatter = go 0 "" . unSpec+runFormatter formatter = go 0 [] . unSpec where- go nesting _ (SpecGroup group xs) = do+ go nesting groups (SpecGroup group xs) = do exampleGroupStarted formatter nesting group- ys <- mapM (go (succ nesting) group) xs+ ys <- mapM (go (succ nesting) (group : groups)) xs return (SpecGroup group ys)- go nesting group (SpecExample requirement e) = do+ go nesting groups (SpecExample requirement e) = do result <- liftIO $ safeEvaluateExample e case result of Success -> do@@ -31,15 +31,23 @@ increaseFailCount exampleFailed formatter nesting requirement err n <- getFailCount- addFailMessage $ failureDetails group requirement err n+ addFailMessage $ failureDetails groups requirement err n Pending reason -> do increasePendingCount examplePending formatter nesting requirement reason return (SpecExample requirement result) -failureDetails :: String -> String -> String -> Int -> String-failureDetails group requirement err i =- concat [ show i, ") ", group, " ", requirement, " FAILED", if null err then "" else "\n" ++ err ]+failureDetails :: [String] -> String -> String -> Int -> String+failureDetails groups requirement err i =+ show i ++ ") " ++ groups_ ++ requirement ++ " FAILED" ++ err_+ where+ err_+ | null err = ""+ | otherwise = "\n" ++ err+ groups_ = case groups of+ [x] -> x ++ " "+ _ -> concatMap (++ " - ") (reverse groups)+ -- | Use in place of `hspec` to also exit the program with an @ExitCode@ hspecX :: Specs -> IO a
hspec.cabal view
@@ -1,5 +1,5 @@ name: hspec-version: 1.1.1+version: 1.1.2 cabal-version: >= 1.8 build-type: Simple license: BSD3