hspec-expectations-lifted-0.5.0: A version of hspec-expectations generalized to MonadIO

Safe HaskellNone

Test.Hspec.Expectations.Lifted

Contents

Description

Synopsis

Setting expectations

expectationFailure :: MonadIO m => String -> m ()Source

This is just an alias for HUnit's assertFailure.

shouldBe :: (Show a, Eq a, MonadIO m) => a -> a -> m ()Source

actual `shouldBe` expected sets the expectation that actual is equal to expected (this is just an alias for @?=).

shouldSatisfy :: (Show a, MonadIO m) => a -> (a -> Bool) -> m ()Source

v `shouldSatisfy` p sets the expectation that p v is True.

shouldContain :: (Show a, Eq a, MonadIO m) => [a] -> [a] -> m ()Source

list `shouldContain` sublist sets the expectation that sublist is contained, wholly and intact, anywhere in the second.

shouldMatchList :: (Show a, Eq a, MonadIO m) => [a] -> [a] -> m ()Source

xs `shouldMatchList` ys sets the expectation that xs has the same elements that ys has, possibly in another order

shouldReturn :: (Show a, Eq a, MonadIO m) => m a -> a -> m ()Source

action `shouldReturn` expected sets the expectation that action returns expected.