hspec 1.1.0 → 1.1.1
raw patch · 3 files changed
+19/−15 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ Test.Hspec.Monadic: type Spec = SpecM ()
- Test.Hspec.Monadic: describe :: String -> Specs -> Specs
+ Test.Hspec.Monadic: describe :: String -> Spec -> Spec
- Test.Hspec.Monadic: descriptions :: [Specs] -> Specs
+ Test.Hspec.Monadic: descriptions :: [Spec] -> Spec
- Test.Hspec.Monadic: fromSpecList :: [Spec] -> Specs
+ Test.Hspec.Monadic: fromSpecList :: [Spec] -> Spec
- Test.Hspec.Monadic: hHspec :: Handle -> Specs -> IO [EvaluatedSpec]
+ Test.Hspec.Monadic: hHspec :: Handle -> Spec -> IO [EvaluatedSpec]
- Test.Hspec.Monadic: hspec :: Specs -> IO [EvaluatedSpec]
+ Test.Hspec.Monadic: hspec :: Spec -> IO [EvaluatedSpec]
- Test.Hspec.Monadic: hspecB :: Specs -> IO Bool
+ Test.Hspec.Monadic: hspecB :: Spec -> IO Bool
- Test.Hspec.Monadic: hspecX :: Specs -> IO a
+ Test.Hspec.Monadic: hspecX :: Spec -> IO a
- Test.Hspec.Monadic: it :: Example v => String -> v -> Specs
+ Test.Hspec.Monadic: it :: Example v => String -> v -> Spec
- Test.Hspec.Monadic: runSpecM :: Specs -> [Spec]
+ Test.Hspec.Monadic: runSpecM :: Spec -> [Spec]
- Test.Hspec.QuickCheck: prop :: Testable t => String -> t -> Specs
+ Test.Hspec.QuickCheck: prop :: Testable t => String -> t -> Spec
Files
- Test/Hspec/Monadic.hs +17/−13
- Test/Hspec/QuickCheck.hs +1/−1
- hspec.cabal +1/−1
Test/Hspec/Monadic.hs view
@@ -10,7 +10,7 @@ -- * Introduction -- $intro -- * Types- Specs+ Spec , Example , Pending @@ -30,8 +30,9 @@ , runSpecM , fromSpecList --- * Deprecated functions+-- * Deprecated types and functions , descriptions+, Specs ) where import System.IO@@ -116,47 +117,47 @@ -- > vectorOf n (elements "0123456789") -- -type Specs = SpecM ()+type Spec = SpecM () newtype SpecM a = SpecM (Writer [Core.Spec] a) deriving Monad -- | Create a document of the given specs and write it to stdout.-hspec :: Specs -> IO [EvaluatedSpec]+hspec :: Spec -> IO [EvaluatedSpec] hspec = Runner.hspec . runSpecM -- | Use in place of `hspec` to also exit the program with an @ExitCode@-hspecX :: Specs -> IO a+hspecX :: Spec -> IO a hspecX = Runner.hspecX . runSpecM -- | Use in place of hspec to also give a @Bool@ success indication-hspecB :: Specs -> IO Bool+hspecB :: Spec -> IO Bool hspecB = Runner.hspecB . runSpecM -- | Create a document of the given specs and write it to the given handle. -- -- > writeReport filename specs = withFile filename WriteMode (\h -> hHspec h specs) ---hHspec :: Handle -> Specs -> IO [EvaluatedSpec]+hHspec :: Handle -> Spec -> IO [EvaluatedSpec] hHspec h = Runner.hHspec h . runSpecM -- | Convert a monadic spec into a non-monadic spec.-runSpecM :: Specs -> [Core.Spec]+runSpecM :: Spec -> [Core.Spec] runSpecM (SpecM specs) = execWriter specs -- | Convert a non-monadic spec into a monadic spec.-fromSpecList :: [Core.Spec] -> Specs+fromSpecList :: [Core.Spec] -> Spec fromSpecList = SpecM . tell -describe :: String -> Specs -> Specs+describe :: String -> Spec -> Spec describe label action = SpecM . tell $ [Core.describe label (runSpecM action)] {--context :: String -> Specs -> Specs+context :: String -> Spec -> Spec context = describe -} -it :: Example v => String -> v -> Specs+it :: Example v => String -> v -> Spec it label action = (SpecM . tell) [Core.it label action] -- | A pending example.@@ -176,6 +177,9 @@ pending = Pending.pending -- | DEPRECATED: Use `sequence_` instead.-descriptions :: [Specs] -> Specs+descriptions :: [Spec] -> Spec descriptions = sequence_ {-# DEPRECATED descriptions "use sequence_ instead" #-}++-- | DEPRECATED: Use `Spec` instead+type Specs = SpecM ()
Test/Hspec/QuickCheck.hs view
@@ -30,7 +30,7 @@ import qualified Test.Hspec.Monadic as DSL -- | Monadic DSL shortcut, use this instead of `DSL.it`.-prop :: QC.Testable t => String -> t -> DSL.Specs+prop :: QC.Testable t => String -> t -> DSL.Spec prop n p = DSL.it n (QC.property p) instance Example QC.Property where
hspec.cabal view
@@ -1,5 +1,5 @@ name: hspec-version: 1.1.0+version: 1.1.1 cabal-version: >= 1.8 build-type: Simple license: BSD3