| Copyright | (c) 2022 Tim Emiola |
|---|---|
| License | BSD3 |
| Maintainer | Tim Emiola <adetokunbo@emio.la> |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Test.Hspec.Benri
Description
Provides convenient functions for writing hspec tests
Synopsis
- endsThen :: Show a => IO a -> (a -> Bool) -> IO ()
- endsJust :: (HasCallStack, Show a, Eq a) => IO (Maybe a) -> a -> Expectation
- endsJust_ :: Show a => IO (Maybe a) -> IO ()
- endsNothing :: (Show a, Eq a) => IO (Maybe a) -> IO ()
- endsLeft :: (HasCallStack, Show a, Eq a, Show b, Eq b) => IO (Either a b) -> a -> Expectation
- endsLeft_ :: (Show a, Show b) => IO (Either a b) -> IO ()
- endsRight :: (HasCallStack, Show a, Eq a, Show b, Eq b) => IO (Either a b) -> b -> Expectation
- endsRight_ :: (Show a, Show b) => IO (Either a b) -> IO ()
expect a monadic value
endsThen :: Show a => IO a -> (a -> Bool) -> IO () infix 1 Source #
action `endsThen` expected sets the expectation that action
returns expected.
expect a monadic Maybe
endsJust :: (HasCallStack, Show a, Eq a) => IO (Maybe a) -> a -> Expectation infix 1 Source #
action `endsJust` expected sets the expectation that action
returns Just expected@.
endsJust_ :: Show a => IO (Maybe a) -> IO () Source #
action `endsJust_` sets the expectation that action
returns Just _@.
endsNothing :: (Show a, Eq a) => IO (Maybe a) -> IO () Source #
action `endsNothing` expected sets the expectation that action
returns Nothing.
expect a monadic Either
endsLeft :: (HasCallStack, Show a, Eq a, Show b, Eq b) => IO (Either a b) -> a -> Expectation infix 1 Source #
action `endsLeft` expected sets the expectation that action
returns Left expected@.
endsLeft_ :: (Show a, Show b) => IO (Either a b) -> IO () Source #
action `endsLeft_` sets the expectation that action
returns Left _@.