A variant of flatMap
that ignores the value returned by this expectation.
Returns an expectation that models the execution of this expectation,
followed by passing of its value to the specified continuation function k
,
followed by the expectation that it returns.
Returns an expectation that models the execution of this expectation,
followed by passing of its value to the specified continuation function k
,
followed by the expectation that it returns.
{{ val mockClock = (MockClock.sleep(equalTo(1.second)) returns unit).flatMap(_ => MockClock.nanoTime returns value(5L)) }}
Converts this Expectation to ZManaged mock environment.
Returns empty expectation.
Returns empty expectation.
This is required for the for-comprehension syntax.
A named alias for *>
An
Expectation[-M, +E, +A]
is an immutable data structure that represents expectations on moduleM
capabilities.This structure is a monad, because we need the sequential composability and in Scala we get the convenient for-comprehension syntax for free.
Empty
models expectation for no calls, the monadicunit
valueCall
models a call onM
modules capability that takes argumentsI
and returns an effect that may fail with an errorE
or produce a singleA
FlatMap
models sequential composition of expectationsThe whole structure is not supposed to be consumed directly by the end user, instead it should be converted into a mocked environment (wrapped in Managed) either explicitly via
managedEnv
method or via implicit conversion.