benri-hspec-0.1.0.0: Simplify tests where Either or Maybe types are returned from monadic code
Copyright(c) 2022 Tim Emiola
LicenseBSD3
MaintainerTim Emiola <adetokunbo@emio.la>
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.Hspec.Benri

Description

Provides convenient functions for writing hspec tests

Synopsis

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 _@.

endsRight :: (HasCallStack, Show a, Eq a, Show b, Eq b) => IO (Either a b) -> b -> Expectation infix 1 Source #

action `endsRight` expected sets the expectation that action returns Right expected@.

endsRight_ :: (Show a, Show b) => IO (Either a b) -> IO () Source #

action `endsRight_` sets the expectation that action returns Right _@.