Safe Haskell | None |
---|

Introductory documentation: https://github.com/sol/hspec-expectations#readme

- expectationFailure :: MonadIO m => String -> m ()
- shouldBe :: (Show a, Eq a, MonadIO m) => a -> a -> m ()
- shouldSatisfy :: (Show a, MonadIO m) => a -> (a -> Bool) -> m ()
- shouldContain :: (Show a, Eq a, MonadIO m) => [a] -> [a] -> m ()
- shouldMatchList :: (Show a, Eq a, MonadIO m) => [a] -> [a] -> m ()
- shouldReturn :: (Show a, Eq a, MonadIO m) => m a -> a -> m ()

# 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`

.