hspec 1.12.3 → 1.12.4
raw patch · 7 files changed
+31/−19 lines, 7 filesdep ~basedep ~deepseqPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, deepseq
API changes (from Hackage documentation)
+ Test.Hspec.Core: specGroup :: String -> [SpecTree] -> SpecTree
+ Test.Hspec.Core: specItem :: Example a => String -> a -> SpecTree
Files
- hspec.cabal +1/−1
- src/Test/Hspec.hs +3/−3
- src/Test/Hspec/Core.hs +12/−0
- src/Test/Hspec/Core/Type.hs +8/−8
- src/Test/Hspec/Discover.hs +1/−1
- src/Test/Hspec/HUnit.hs +5/−5
- test/Test/Hspec/Core/TypeSpec.hs +1/−1
hspec.cabal view
@@ -1,5 +1,5 @@ name: hspec-version: 1.12.3+version: 1.12.4 license: MIT license-file: LICENSE copyright: (c) 2011-2014 Simon Hengel,
src/Test/Hspec.hs view
@@ -37,7 +37,7 @@ import Control.Exception (finally) import Control.Concurrent.MVar -import Test.Hspec.Core.Type hiding (describe, it)+import Test.Hspec.Core.Type import Test.Hspec.Runner import Test.Hspec.HUnit () import Test.Hspec.Expectations@@ -45,7 +45,7 @@ -- | Combine a list of specs into a larger spec. describe :: String -> Spec -> Spec-describe label spec = runIO (runSpecM spec) >>= fromSpecList . return . Core.describe label+describe label spec = runIO (runSpecM spec) >>= fromSpecList . return . Core.specGroup label -- | An alias for `describe`. context :: String -> Spec -> Spec@@ -63,7 +63,7 @@ -- > it "returns a positive number when given a negative number" $ -- > absolute (-1) == 1 it :: Example a => String -> a -> Spec-it label action = fromSpecList [Core.it label action]+it label action = fromSpecList [Core.specItem label action] -- | An alias for `it`. specify :: Example a => String -> a -> Spec
src/Test/Hspec/Core.hs view
@@ -25,6 +25,10 @@ , LocationAccuracy(..) , mapSpecItem , modifyParams+, specGroup+, specItem++-- * Deprecated functions , describe , it ) where@@ -33,3 +37,11 @@ modifyParams :: (Params -> Params) -> Spec -> Spec modifyParams f = mapSpecItem $ \item -> item {itemExample = \p -> (itemExample item) (f p)}++{-# DEPRECATED describe "use `specGroup` instead" #-}+describe :: String -> [SpecTree] -> SpecTree+describe = specGroup++{-# DEPRECATED it "use `specItem` instead" #-}+it :: Example a => String -> a -> SpecTree+it = specItem
src/Test/Hspec/Core/Type.hs view
@@ -16,8 +16,8 @@ , Progress , ProgressCallback -, describe-, it+, specGroup+, specItem , forceResult , runIO@@ -124,17 +124,17 @@ , locationAccuracy :: LocationAccuracy } deriving (Eq, Show) --- | The @describe@ function combines a list of specs into a larger spec.-describe :: String -> [SpecTree] -> SpecTree-describe s = SpecGroup msg+-- | The @specGroup@ function combines a list of specs into a larger spec.+specGroup :: String -> [SpecTree] -> SpecTree+specGroup s = SpecGroup msg where msg | null s = "(no description given)" | otherwise = s --- | Create a spec item.-it :: Example a => String -> a -> SpecTree-it s e = SpecItem $ Item requirement Nothing False (evaluateExample e)+-- | The @specItem@ function creates a spec item.+specItem :: Example a => String -> a -> SpecTree+specItem s e = SpecItem $ Item requirement Nothing False (evaluateExample e) where requirement | null s = "(unspecified behavior)"
src/Test/Hspec/Discover.hs view
@@ -17,7 +17,7 @@ import Control.Monad.Trans.State import Test.Hspec-import Test.Hspec.Core.Type hiding (describe)+import Test.Hspec.Core.Type import Test.Hspec.Runner import Test.Hspec.Runner.Tree import Test.Hspec.Formatters
src/Test/Hspec/HUnit.hs view
@@ -16,8 +16,8 @@ where go :: Test -> SpecTree go t_ = case t_ of- TestLabel s (TestCase e) -> it s e- TestLabel s (TestList xs) -> describe s (map go xs)- TestLabel s x -> describe s [go x]- TestList xs -> describe "<unlabeled>" (map go xs)- TestCase e -> it "<unlabeled>" e+ TestLabel s (TestCase e) -> specItem s e+ TestLabel s (TestList xs) -> specGroup s (map go xs)+ TestLabel s x -> specGroup s [go x]+ TestList xs -> specGroup "<unlabeled>" (map go xs)+ TestCase e -> specItem "<unlabeled>" e
test/Test/Hspec/Core/TypeSpec.hs view
@@ -6,7 +6,7 @@ import Data.List import Data.IORef -import qualified Test.Hspec.Core.Type as H hiding (describe, it)+import qualified Test.Hspec.Core.Type as H import qualified Test.Hspec as H import qualified Test.Hspec.Runner as H