packages feed

hspec 2.1.8 → 2.1.9

raw patch · 3 files changed

+24/−8 lines, 3 filesdep ~hspec-coredep ~hspec-discoverdep ~hspec-expectationsPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: hspec-core, hspec-discover, hspec-expectations

API changes (from Hackage documentation)

Files

hspec.cabal view
@@ -1,5 +1,5 @@ name:             hspec-version:          2.1.8+version:          2.1.9 license:          MIT license-file:     LICENSE copyright:        (c) 2011-2015 Simon Hengel,@@ -41,9 +41,9 @@       src   build-depends:       base == 4.*-    , hspec-core == 2.1.8-    , hspec-discover == 2.1.8-    , hspec-expectations == 0.7.0.*+    , hspec-core == 2.1.9+    , hspec-discover == 2.1.9+    , hspec-expectations == 0.7.1.*     , transformers >= 0.2.2.0     , QuickCheck >= 2.5.1     , HUnit >= 1.2.5
src/Test/Hspec/QuickCheck.hs view
@@ -1,3 +1,8 @@+{-# LANGUAGE CPP #-}+#if MIN_VERSION_base(4,8,1)+#define HAS_SOURCE_LOCATIONS+{-# LANGUAGE ImplicitParams #-}+#endif module Test.Hspec.QuickCheck ( -- * Params   modifyMaxSuccess@@ -8,6 +13,10 @@ , prop ) where +#ifdef HAS_SOURCE_LOCATIONS+import           GHC.Stack+#endif+ import           Test.Hspec import           Test.QuickCheck import           Test.Hspec.Core.QuickCheck@@ -20,5 +29,9 @@ -- -- > it ".." $ property $ -- >   ..-prop :: Testable prop => String -> prop -> Spec+#ifdef HAS_SOURCE_LOCATIONS+prop :: (?loc :: CallStack, Testable prop) => String -> prop -> Spec+#else+prop :: (Testable prop) => String -> prop -> Spec+#endif prop s = it s . property
test/Test/Hspec/DiscoverSpec.hs view
@@ -15,6 +15,9 @@ shouldHaveLocation :: Item a -> (String, Int) -> Expectation item `shouldHaveLocation` (src, line) = itemLocation item `shouldBe` Just (Location src line 0 BestEffort) +removeLocations :: H.SpecWith a -> H.SpecWith a+removeLocations = H.mapSpecItem_ (\item -> item{H.itemLocation = Nothing})+ main :: IO () main = hspec spec @@ -30,7 +33,7 @@             ""             strlit "baz"       withFileContent c $ \src -> do-        [Leaf item1, Leaf item2, Leaf item3] <- runSpecM . H.postProcessSpec src $ do+        [Leaf item1, Leaf item2, Leaf item3] <- runSpecM . H.postProcessSpec src . removeLocations $ do           H.it "foo" True           H.it "bar" True           H.it "baz" True@@ -45,7 +48,7 @@               strlit "foo"               strlit "foo"         withFileContent c $ \src -> do-          [Leaf item1, Leaf item2, Leaf item3] <- runSpecM . H.postProcessSpec src $ do+          [Leaf item1, Leaf item2, Leaf item3] <- runSpecM . H.postProcessSpec src . removeLocations $ do             H.it "foo" True             H.it "foo" True             H.it "foo" True@@ -59,7 +62,7 @@                 strlit "foo"                 strlit "foo"           withFileContent c $ \src -> do-            [Leaf item1, Leaf item2, Leaf item3] <- runSpecM . H.postProcessSpec src $ do+            [Leaf item1, Leaf item2, Leaf item3] <- runSpecM . H.postProcessSpec src . removeLocations $ do               H.it "foo" True               H.it "foo" True               H.it "foo" True