packages feed

test-shouldbe 0.1.0 → 0.2.0

raw patch · 2 files changed

+7/−2 lines, 2 files

Files

src/Test/HUnit/ShouldBe.hs view
@@ -5,6 +5,7 @@ -- * Making assertions   shouldBe , shouldSatisfy+, shouldReturn  -- * Checking for exceptions , shouldThrow@@ -38,7 +39,7 @@ import           Data.Typeable import           Control.Arrow ((&&&)) -infix 1 `shouldBe`, `shouldSatisfy`, `shouldThrow`+infix 1 `shouldBe`, `shouldSatisfy`, `shouldReturn`, `shouldThrow`  -- | -- @actual \`shouldBe\` expected@ asserts that @actual@ is equal to @expected@@@ -51,6 +52,10 @@ shouldSatisfy :: (Show a) => a -> (a -> Bool) -> Assertion v `shouldSatisfy` p = assertBool (show v ++ " did not satisfy predicate!") (p v) +-- |+-- @action \`shouldReturn\` expected@ asserts that @action@ returns @expected@.+shouldReturn :: (Show a, Eq a) => IO a -> a -> Assertion+action `shouldReturn` expected = action >>= (`shouldBe` expected)  -- | -- A @Selector@ is a predicate; it can simultaneously constrain the type and
test-shouldbe.cabal view
@@ -1,5 +1,5 @@ name:             test-shouldbe-version:          0.1.0+version:          0.2.0 synopsis:         Catchy combinators for HUnit description:      Catchy combinators for HUnit: <https://github.com/sol/test-shouldbe#readme> license:          MIT