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
  • object TestClock extends Serializable
    Definition Classes
    test
  • Data
  • Sleep
  • SuspendedWarningData
  • Test
  • WarningData

final case class Test(clockState: Atomic[Data], live: Live, annotations: Annotations, warningState: Synchronized[WarningData], suspendedWarningState: Synchronized[SuspendedWarningData]) extends Clock with TestClock with TestClockPlatformSpecific with Product with Serializable

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Test
  2. Product
  3. Equals
  4. TestClockPlatformSpecific
  5. TestClock
  6. Restorable
  7. Clock
  8. Serializable
  9. AnyRef
  10. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Test(clockState: Atomic[Data], live: Live, annotations: Annotations, warningState: Synchronized[WarningData], suspendedWarningState: Synchronized[SuspendedWarningData])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def adjust(duration: zio.Duration)(implicit trace: ZTraceElement): UIO[Unit]

    Increments the current clock time by the specified duration.

    Increments the current clock time by the specified duration. Any effects that were scheduled to occur on or before the new time will be run in order.

    Definition Classes
    TestTestClock
  5. val annotations: Annotations
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. val clockState: Atomic[Data]
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  9. def currentDateTime(implicit trace: ZTraceElement): UIO[OffsetDateTime]

    Returns the current clock time as an OffsetDateTime.

    Returns the current clock time as an OffsetDateTime.

    Definition Classes
    Test → Clock
  10. def currentTime(unit: => TimeUnit)(implicit trace: ZTraceElement): UIO[Long]

    Returns the current clock time in the specified time unit.

    Returns the current clock time in the specified time unit.

    Definition Classes
    Test → Clock
  11. final def driver[Env, In, Out](schedule: Schedule[Env, In, Out])(implicit trace: ZTraceElement): UIO[Driver[State, Env, In, Out]]
    Definition Classes
    Clock
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. def instant(implicit trace: ZTraceElement): UIO[Instant]

    Returns the current clock time as an Instant.

    Returns the current clock time as an Instant.

    Definition Classes
    Test → Clock
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. val live: Live
  18. def localDateTime(implicit trace: ZTraceElement): UIO[LocalDateTime]

    Returns the current clock time as a LocalDateTime.

    Returns the current clock time as a LocalDateTime.

    Definition Classes
    Test → Clock
  19. def nanoTime(implicit trace: ZTraceElement): UIO[Long]

    Returns the current clock time in nanoseconds.

    Returns the current clock time in nanoseconds.

    Definition Classes
    Test → Clock
  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. def productElementNames: Iterator[String]
    Definition Classes
    Product
  24. final def repeat[R, R1 <: R, E, A, B](zio: => ZIO[R, E, A])(schedule: => Schedule[R1, A, B])(implicit trace: ZTraceElement): ZIO[R1, E, B]
    Definition Classes
    Clock
  25. final def repeatOrElse[R, R1 <: R, E, E2, A, B](zio: => ZIO[R, E, A])(schedule: => Schedule[R1, A, B], orElse: (E, Option[B]) => ZIO[R1, E2, B])(implicit trace: ZTraceElement): ZIO[R1, E2, B]
    Definition Classes
    Clock
  26. final def repeatOrElseEither[R, R1 <: R, E, E2, A, B, C](zio0: => ZIO[R, E, A])(schedule0: => Schedule[R1, A, B], orElse: (E, Option[B]) => ZIO[R1, E2, C])(implicit trace: ZTraceElement): ZIO[R1, E2, Either[C, B]]
    Definition Classes
    Clock
  27. final def retry[R, R1 <: R, E, A, S](zio: => ZIO[R, E, A])(policy: Schedule[R1, E, S])(implicit ev: CanFail[E], trace: ZTraceElement): ZIO[R1, E, A]
    Definition Classes
    Clock
  28. final def retryOrElse[R, R1 <: R, E, E1, A, A1 >: A, S](zio: => ZIO[R, E, A])(policy: => Schedule[R1, E, S], orElse: (E, S) => ZIO[R1, E1, A1])(implicit ev: CanFail[E], trace: ZTraceElement): ZIO[R1, E1, A1]
    Definition Classes
    Clock
  29. final def retryOrElseEither[R, R1 <: R, E, E1, A, B, Out](zio0: => ZIO[R, E, A])(schedule0: => Schedule[R1, E, Out], orElse: (E, Out) => ZIO[R1, E1, B])(implicit ev: CanFail[E], trace: ZTraceElement): ZIO[R1, E1, Either[B, A]]
    Definition Classes
    Clock
  30. def save(implicit trace: ZTraceElement): UIO[UIO[Unit]]

    Saves the TestClock's current state in an effect which, when run, will restore the TestClock state to the saved state

    Saves the TestClock's current state in an effect which, when run, will restore the TestClock state to the saved state

    Definition Classes
    TestRestorable
  31. final def schedule[R, R1 <: R, E, A, B](zio: => ZIO[R, E, A])(schedule: => Schedule[R1, Any, B])(implicit trace: ZTraceElement): ZIO[R1, E, B]
    Definition Classes
    Clock
  32. final def scheduleFrom[R, R1 <: R, E, A, A1 >: A, B](zio0: => ZIO[R, E, A])(a: => A1)(schedule0: => Schedule[R1, A1, B])(implicit trace: ZTraceElement): ZIO[R1, E, B]
    Definition Classes
    Clock
  33. def scheduler(implicit trace: ZTraceElement): UIO[Scheduler]
    Definition Classes
    TestClockPlatformSpecific
  34. def setDateTime(dateTime: OffsetDateTime)(implicit trace: ZTraceElement): UIO[Unit]

    Sets the current clock time to the specified OffsetDateTime.

    Sets the current clock time to the specified OffsetDateTime. Any effects that were scheduled to occur on or before the new time will be run in order.

    Definition Classes
    TestTestClock
  35. def setTime(duration: zio.Duration)(implicit trace: ZTraceElement): UIO[Unit]

    Sets the current clock time to the specified time in terms of duration since the epoch.

    Sets the current clock time to the specified time in terms of duration since the epoch. Any effects that were scheduled to occur on or before the new time will immediately be run in order.

    Definition Classes
    TestTestClock
  36. def setTimeZone(zone: ZoneId)(implicit trace: ZTraceElement): UIO[Unit]

    Sets the time zone to the specified time zone.

    Sets the time zone to the specified time zone. The clock time in terms of nanoseconds since the epoch will not be adjusted and no scheduled effects will be run as a result of this method.

    Definition Classes
    TestTestClock
  37. def sleep(duration: => zio.Duration)(implicit trace: ZTraceElement): UIO[Unit]

    Semantically blocks the current fiber until the clock time is equal to or greater than the specified duration.

    Semantically blocks the current fiber until the clock time is equal to or greater than the specified duration. Once the clock time is adjusted to on or after the duration, the fiber will automatically be resumed.

    Definition Classes
    Test → Clock
  38. def sleeps(implicit trace: ZTraceElement): UIO[List[zio.Duration]]

    Returns a list of the times at which all queued effects are scheduled to resume.

    Returns a list of the times at which all queued effects are scheduled to resume.

    Definition Classes
    TestTestClock
  39. def supervisedFibers(implicit trace: ZTraceElement): UIO[SortedSet[Fiber.Runtime[Any, Any]]]

    Returns a set of all fibers in this test.

  40. val suspendedWarningState: Synchronized[SuspendedWarningData]
  41. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  42. def timeZone(implicit trace: ZTraceElement): UIO[ZoneId]

    Returns the time zone.

    Returns the time zone.

    Definition Classes
    TestTestClock
  43. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  44. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  45. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  46. val warningState: Synchronized[WarningData]

Inherited from Product

Inherited from Equals

Inherited from TestClock

Inherited from Restorable

Inherited from Clock

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped