sealed trait Expectation[-M, +E, +A] extends AnyRef
An Expectation[-M, +E, +A] is an immutable data structure that represents
expectations on module M capabilities.
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 expectations
The 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 toLayer method or via implicit conversion.
- Self Type
- Expectation[M, E, A]
- Alphabetic
- By Inheritance
- Expectation
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
*>[M1 <: M, E1 >: E, B](that: Expectation[M1, E1, B]): Expectation[M1, E1, B]
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)) }}
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
final
def
toLayer[M1 <: M](implicit mockable: Mockable[M1]): NoDeps[Nothing, Has[M1]]
Converts this Expectation to ZManaged mock environment.
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
zipRight[M1 <: M, E1 >: E, B](that: Expectation[M1, E1, B]): Expectation[M1, E1, B]
A named alias for
*>