| Safe Haskell | None |
|---|
Test.Hspec.Expectations.Contrib
Description
Experimental combinators, that may become part of the main distribution, if they turn out to be useful for a wider audience.
- shouldNotBe :: (Show a, Eq a) => a -> a -> Expectation
- shouldNotSatisfy :: Show a => a -> (a -> Bool) -> Expectation
- shouldNotReturn :: (Show a, Eq a) => IO a -> a -> Expectation
- shouldNotContain :: (Show a, Eq a) => [a] -> [a] -> Expectation
- isLeft :: Either a b -> Bool
- isRight :: Either a b -> Bool
Additional combinators for setting expectations
shouldNotBe :: (Show a, Eq a) => a -> a -> ExpectationSource
actual `shouldNotBe` notExpected sets the expectation that actual is not
equal to notExpected
shouldNotSatisfy :: Show a => a -> (a -> Bool) -> ExpectationSource
v `shouldNotSatisfy` p sets the expectation that p v is False.
shouldNotReturn :: (Show a, Eq a) => IO a -> a -> ExpectationSource
action `shouldNotReturn` notExpected sets the expectation that action
does not return notExpected.
shouldNotContain :: (Show a, Eq a) => [a] -> [a] -> ExpectationSource
list `shouldNotContain` sublist sets the expectation that sublist is not
contained anywhere in the second.
Predicates
(useful in combination with shouldSatisfy)