hw-hspec-hedgehog 0.1.0.7 → 0.1.0.8
raw patch · 3 files changed
+28/−12 lines, 3 filesdep ~call-stackPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: call-stack
API changes (from Hackage documentation)
- HaskellWorks.Hspec.Hedgehog: requireProperty :: PropertyT IO () -> Assertion
+ HaskellWorks.Hspec.Hedgehog: requireProperty :: HasCallStack => PropertyT IO () -> Assertion
- HaskellWorks.Hspec.Hedgehog: requireTest :: PropertyT IO () -> Assertion
+ HaskellWorks.Hspec.Hedgehog: requireTest :: HasCallStack => PropertyT IO () -> Assertion
Files
- hw-hspec-hedgehog.cabal +7/−5
- src/HaskellWorks/Hspec/Hedgehog.hs +2/−2
- test/HaskellWorks/Hspec/HedgehogSpec.hs +19/−5
hw-hspec-hedgehog.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: hw-hspec-hedgehog-version: 0.1.0.7+version: 0.1.0.8 synopsis: Interoperability between hspec and hedgehog description: Interoperability between hspec and hedgehog. category: Test@@ -11,7 +11,7 @@ copyright: 2017-2018 John Ky license: BSD-3-Clause license-file: LICENSE-tested-with: GHC == 8.4.2, GHC == 8.2.2, GHC == 8.0.2+tested-with: GHC == 8.4.2, GHC == 8.2.2 build-type: Simple extra-source-files: README.md@@ -22,7 +22,7 @@ common base { build-depends: base >= 4 && < 5 } -common hedgehog { build-depends: hedgehog >= 0.5 && < 0.7 }+common hedgehog { build-depends: hedgehog >= 0.5 && < 1.1 } common hspec { build-depends: hspec >= 2.6 && < 2.8 } common hw-hspec-hedgehog { build-depends: hw-hspec-hedgehog >= 0.1.0.5 && < 0.1.1 } common HUnit { build-depends: HUnit >= 1.5 && < 1.7 }@@ -34,10 +34,10 @@ library import: base, common- , HUnit , call-stack , hedgehog , hspec+ , HUnit , transformers exposed-modules: HaskellWorks.Hspec.Hedgehog other-modules: Paths_hw_hspec_hedgehog@@ -46,8 +46,10 @@ test-suite hw-hspec-hedgehog-test import: base, common- , hspec+ , call-stack , hedgehog+ , hspec+ , HUnit type: exitcode-stdio-1.0 main-is: Spec.hs other-modules:
src/HaskellWorks/Hspec/Hedgehog.hs view
@@ -26,8 +26,8 @@ unless result $ E.throwIO (HUnitFailure location $ Reason "Hedgehog property test failed") -requireProperty :: PropertyT IO () -> Assertion+requireProperty :: HasCallStack => PropertyT IO () -> Assertion requireProperty = require . property -requireTest :: PropertyT IO () -> Assertion+requireTest :: HasCallStack => PropertyT IO () -> Assertion requireTest = require . withTests 1 . property
test/HaskellWorks/Hspec/HedgehogSpec.hs view
@@ -2,12 +2,14 @@ module HaskellWorks.Hspec.HedgehogSpec (spec) where -import HaskellWorks.Hspec.Hedgehog-import Hedgehog-import Test.Hspec+import Data.CallStack+import HaskellWorks.Hspec.Hedgehog+import Hedgehog+import Test.Hspec+import Test.HUnit.Lang -import qualified Hedgehog.Gen as Gen-import qualified Hedgehog.Range as Range+import qualified Hedgehog.Gen as Gen+import qualified Hedgehog.Range as Range {-# ANN module ("HLint: ignore Redundant do" :: String) #-} @@ -17,3 +19,15 @@ require $ property $ do x <- forAll (Gen.int Range.constantBounded) x === x++ it "`require . property` should print a callstack with the test's location when property fails" $+ require (property failure) `shouldThrow` \(HUnitFailure srcLocMaybe _) ->+ fmap srcLocModule srcLocMaybe == Just "HaskellWorks.Hspec.HedgehogSpec"++ it "`requireProperty` should print a callstack with the test's location when property fails" $+ requireProperty failure `shouldThrow` \(HUnitFailure srcLocMaybe _) ->+ fmap srcLocModule srcLocMaybe == Just "HaskellWorks.Hspec.HedgehogSpec"++ it "`requireTest` should print a callstack with the test's location when property fails" $+ requireTest failure `shouldThrow` \(HUnitFailure srcLocMaybe _) ->+ fmap srcLocModule srcLocMaybe == Just "HaskellWorks.Hspec.HedgehogSpec"