hspec-meta 1.11.0 → 1.11.1
raw patch · 3 files changed
+11/−19 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Test.Hspec.Meta: specify :: Example a => String -> a -> Spec
Files
- hspec-meta.cabal +1/−1
- src/Test/Hspec.hs +6/−1
- src/Test/Hspec/Util.hs +4/−17
hspec-meta.cabal view
@@ -1,5 +1,5 @@ name: hspec-meta-version: 1.11.0+version: 1.11.1 license: MIT license-file: LICENSE copyright: (c) 2011-2014 Simon Hengel,
src/Test/Hspec.hs view
@@ -1,7 +1,7 @@ -- | -- Stability: stable ----- Hspec is a testing library for Haskell.+-- Hspec is a testing framework for Haskell. -- -- This is the library reference for Hspec. -- The <http://hspec.github.io/ User's Manual> contains more in-depth@@ -18,6 +18,7 @@ , describe , context , it+, specify , example , pending , pendingWith@@ -60,6 +61,10 @@ -- > absolute (-1) == 1 it :: Example a => String -> a -> Spec it label action = fromSpecList [Core.it label action]++-- | An alias for `it`.+specify :: Example a => String -> a -> Spec+specify = it -- | This is a type restricted version of `id`. It can be used to get better -- error messages on type mismatches.
src/Test/Hspec/Util.hs view
@@ -16,31 +16,18 @@ import Test.Hspec.Compat (showType) ---- | Create a more readable display of a quantity of something.------ Examples:------ >>> pluralize 0 "example"--- "0 examples"------ >>> pluralize 1 "example"--- "1 example"------ >>> pluralize 2 "example"--- "2 examples" pluralize :: Int -> String -> String pluralize 1 s = "1 " ++ s pluralize n s = show n ++ " " ++ s ++ "s" -- | Convert an exception to a string. ----- The type of the exception is included. Here is an example:+-- This is different from `show`. The type of the exception is included, e.g.+-- `E.ArithException` is turned into: ----- >>> import Control.Applicative--- >>> import Control.Exception--- >>> either formatException show <$> (try . evaluate) (1 `div` 0)+-- @ -- "ArithException (divide by zero)"+-- @ formatException :: E.SomeException -> String formatException (E.SomeException e) = showType e ++ " (" ++ show e ++ ")"