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
    
    object MyTest extends ZIOSpecDefault {
      def spec = suite("clock")(
        test("time is non-zero") {
          for {
            time <- Live.live(nanoTime)
          } yield assertTrue(time >= 0L)
        }
      )
    }
    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 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])

Type Members

  1. trait UnsafeAPI extends AnyRef
    Definition Classes
    Clock

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: Trace): 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. def adjustWith[R, E, A](duration: zio.Duration)(zio: ZIO[R, E, A])(implicit trace: Trace): ZIO[R, E, A]

    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
  6. val annotations: Annotations
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. val clockState: Atomic[Data]
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  10. def currentDateTime(implicit trace: Trace): UIO[OffsetDateTime]

    Returns the current clock time as an OffsetDateTime.

    Returns the current clock time as an OffsetDateTime.

    Definition Classes
    TestClock
  11. def currentTime(unit: => ChronoUnit)(implicit trace: Trace, d: DummyImplicit): UIO[Long]
    Definition Classes
    TestClock
  12. def currentTime(unit: => TimeUnit)(implicit trace: Trace): UIO[Long]

    Returns the current clock time in the specified time unit.

    Returns the current clock time in the specified time unit.

    Definition Classes
    TestClock
  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. def instant(implicit trace: Trace): UIO[Instant]

    Returns the current clock time as an Instant.

    Returns the current clock time as an Instant.

    Definition Classes
    TestClock
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. def javaClock(implicit trace: Trace): UIO[java.time.Clock]

    Constructs a java.time.Clock backed by the Clock service.

    Constructs a java.time.Clock backed by the Clock service.

    Definition Classes
    TestClock
  18. val live: Live
  19. def localDateTime(implicit trace: Trace): UIO[LocalDateTime]

    Returns the current clock time as a LocalDateTime.

    Returns the current clock time as a LocalDateTime.

    Definition Classes
    TestClock
  20. def nanoTime(implicit trace: Trace): UIO[Long]

    Returns the current clock time in nanoseconds.

    Returns the current clock time in nanoseconds.

    Definition Classes
    TestClock
  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. def productElementNames: Iterator[String]
    Definition Classes
    Product
  25. def save(implicit trace: Trace): 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
  26. def scheduler(implicit trace: Trace): UIO[Scheduler]
    Definition Classes
    TestClockPlatformSpecific
  27. def setTime(instant: Instant)(implicit trace: Trace): UIO[Unit]

    Sets the current clock time to the specified Instant.

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

    Definition Classes
    TestTestClock
  28. def setTimeZone(zone: ZoneId)(implicit trace: Trace): 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
  29. def sleep(duration: => zio.Duration)(implicit trace: Trace): 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
    TestClock
  30. def sleeps(implicit trace: Trace): UIO[List[Instant]]

    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
  31. def supervisedFibers(implicit trace: Trace): UIO[SortedSet[Fiber.Runtime[Any, Any]]]

    Returns a set of all fibers in this test.

  32. val suspendedWarningState: Synchronized[SuspendedWarningData]
  33. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  34. def timeZone(implicit trace: Trace): UIO[ZoneId]

    Returns the time zone.

    Returns the time zone.

    Definition Classes
    TestTestClock
  35. val unsafe: UnsafeAPI
    Definition Classes
    TestClock
  36. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  37. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  38. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  39. val warningState: Synchronized[WarningData]

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

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