Packages

  • package root
    Definition Classes
    root
  • package zio
    Definition Classes
    root
  • package test

    _ZIO Test_ is a featherweight testing library for effectful programs.

    _ZIO Test_ is a featherweight testing library for effectful programs.

    The library imagines every spec as an ordinary immutable value, providing tremendous potential for composition. Thanks to tight integration with ZIO, specs can use resources (including those requiring disposal), have well- defined linear and parallel semantics, and can benefit from a host of ZIO combinators.

    import zio.test._
    import zio.Clock.nanoTime
    import Assertion.isGreaterThan
    
    object MyTest extends DefaultRunnableSpec {
      def spec = suite("clock")(
        test("time is non-zero") {
          for {
            time <- Live.live(nanoTime)
          } yield assertTrue(time >= 0)
        }
      )
    }
    Definition Classes
    zio
  • package mock
    Definition Classes
    test
  • package internal
    Definition Classes
    mock
  • Capability
  • Expectation
  • Mock
  • MockClock
  • MockConsole
  • MockRandom
  • MockSystem
  • Proxy
  • Result
  • mockable

sealed abstract class Expectation[R] extends AnyRef

An Expectation[R] is an immutable tree structure that represents expectations on environment R.

Self Type
Expectation[R]
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Expectation
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def &&[R0](that: Expectation[R0])(implicit arg0: zio.Tag[R0]): Expectation[R with R0]

    Operator alias for and.

  4. def ++[R0](that: Expectation[R0])(implicit arg0: zio.Tag[R0]): Expectation[R with R0]

    Operator alias for andThen.

  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def and[R0](that: Expectation[R0])(implicit arg0: zio.Tag[R0]): Expectation[R with R0]

    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.readLine(value("foo")) }}

  7. def andThen[R0](that: Expectation[R0])(implicit arg0: zio.Tag[R0]): Expectation[R with R0]

    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.readLine(value("foo")) }}

  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def atLeast(min: Int): Expectation[R]

    Lower-bounded variant of repeated, produces a new expectation to satisfy itself sequentially at least given number of times.

  10. def atMost(max: Int): Expectation[R]

    Upper-bounded variant of repeated, produces a new expectation to satisfy itself sequentially at most given number of times.

  11. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. def exactly(times: Int): Expectation[R]

    Produces a new expectation to satisfy itself exactly the given number of times.

  15. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  16. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. def optional: Expectation[R]

    Alias for atMost(1), produces a new expectation to satisfy itself at most once.

  23. def or[R0](that: Expectation[R0])(implicit arg0: zio.Tag[R0]): Expectation[R with R0]

    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.readLine(value("foo")) }}

  24. def repeats(range: Range): Expectation[R]

    Repeats this expectation withing given bounds, producing a new expectation to satisfy itself sequentially given number of times.

    Repeats 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).

  25. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  26. def thrice: Expectation[R]

    Alias for exactly(3), produces a new expectation to satisfy itself exactly three times.

  27. def toLayer(implicit trace: ZTraceElement): ULayer[R]

    Converts this expectation to ZLayer.

  28. def toString(): String
    Definition Classes
    AnyRef → Any
  29. def twice: Expectation[R]

    Alias for exactly(2), produces a new expectation to satisfy itself exactly two times.

  30. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  31. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  32. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  33. def ||[R0](that: Expectation[R0])(implicit arg0: zio.Tag[R0]): Expectation[R with R0]

    Operator alias for or.

Inherited from AnyRef

Inherited from Any

Ungrouped