Operator alias for and
.
Operator alias for andThen
.
Compose two expectations, producing a new expectation to satisfy both.
Compose two expectations, producing a new expectation to satisfy both.
{{ val mockEnv = MockClock.sleep(equalTo(1.second)) and MockConsole.getStrLn(value("foo")) }}
Compose two expectations, producing a new expectation to satisfy both sequentially.
Compose two expectations, producing a new expectation to satisfy both sequentially.
{{ val mockEnv = MockClock.sleep(equalTo(1.second)) andThen MockConsole.getStrLn(value("foo")) }}
Lower-bounded variant of repeated
, produces a new expectation to satisfy
itself sequentially at least given number of times.
Upper-bounded variant of repeated
, produces a new expectation to satisfy
itself sequentially at most given number of times.
Alias for atMost(1)
, produces a new expectation to satisfy itself at most once.
Compose two expectations, producing a new expectation to satisfy one of them.
Compose two expectations, producing a new expectation to satisfy one of them.
{{ val mockEnv = MockClock.sleep(equalTo(1.second)) or MockConsole.getStrLn(value("foo")) }}
Repeates this expectation withing given bounds, producing a new expectation to satisfy itself sequentially given number of times.
Repeates this expectation withing given bounds, producing a new expectation to satisfy itself sequentially given number of times.
{{ val mockEnv = MockClock.sleep(equalTo(1.second)).repeats(1, 5) }}
NOTE: once another repetition starts executing, it must be completed in order to satisfy the composite expectation. For example (A ++ B).repeats(1, 2) will be satisfied by either A->B (one repetition) or A->B->A->B (two repetitions), but will fail on A->B->A (incomplete second repetition).
Operator alias for or
.
An
Expectation[R]
is an immutable tree structure that represents expectations on environmentR
.