Compose two expectations, producing a new expectation to satisfying both sequentially.
Compose two expectations, producing a new expectation to satisfying both sequentially.
{{ val mockClock = (MockClock.sleep(equalTo(1.second)) returns unit) *> (MockClock.nanoTime returns value(5L)) }}
Converts this Expectation to ZManaged mock environment.
A named alias for *>
An
Expectation[-M, +E, +A]is an immutable data structure that represents expectations on moduleMcapabilities.This structure is a monad, because we need the sequential composability and in Scala we get the convenient for-comprehension syntax for free.
Emptymodels expectation for no calls, the monadicunitvalueCallmodels a call onMmodules capability that takes argumentsIand returns an effect that may fail with an errorEor produce a singleAFlatMapmodels 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 layer) either explicitly via
toLayermethod or via implicit conversion.