package testkit

Source
package.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. testkit
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. trait ApplicativeErrorGenerators[F[_], E] extends ApplicativeGenerators[F]
  2. trait ApplicativeGenerators[F[_]] extends Generators1[F]
  3. trait AsyncGenerators[F[_]] extends GenTemporalGenerators[F, Throwable] with SyncGenerators[F]
  4. trait AsyncGeneratorsWithoutEvalShift[F[_]] extends GenTemporalGenerators[F, Throwable] with SyncGenerators[F]
  5. trait ClockGenerators[F[_]] extends Generators1[F]
  6. trait FreeSyncEq extends AnyRef
  7. trait GenK[F[_]] extends Serializable
  8. trait GenSpawnGenerators[F[_], E] extends MonadCancelGenerators[F, E]
  9. trait GenTemporalGenerators[F[_], E] extends GenSpawnGenerators[F, E] with ClockGenerators[F]
  10. trait Generators1[F[_]] extends Serializable
  11. trait MonadCancelGenerators[F[_], E] extends MonadErrorGenerators[F, E]
  12. trait MonadErrorGenerators[F[_], E] extends MonadGenerators[F] with ApplicativeErrorGenerators[F, E]
  13. trait MonadGenerators[F[_]] extends ApplicativeGenerators[F]
  14. trait OutcomeGenerators extends AnyRef
  15. trait ParallelFGenerators extends AnyRef
  16. trait SyncGenerators[F[_]] extends MonadErrorGenerators[F, Throwable] with ClockGenerators[F]
  17. trait SyncTypeGenerators extends AnyRef
  18. final class TestContext extends ExecutionContext

    A scala.concurrent.ExecutionContext implementation that can simulate async boundaries and time passage, useful for law testing purposes.

    A scala.concurrent.ExecutionContext implementation that can simulate async boundaries and time passage, useful for law testing purposes. This is intended primarily for datatype implementors. Most end-users will be better served by the cats.effect.testkit.TestControl utility, rather than using TestContext directly.

    Usage for simulating an ExecutionContext):

    implicit val ec = TestContext()
    
    ec.execute(new Runnable { def run() = println("task1") })
    
    ex.execute(new Runnable {
      def run() = {
        println("outer")
    
        ec.execute(new Runnable {
          def run() = println("inner")
        })
      }
    })
    
    // Nothing executes until `tick` gets called
    ec.tick()
    
    // Testing the resulting state
    assert(ec.state.tasks.isEmpty)
    assert(ec.state.lastReportedFailure == None)
  19. final case class TestException(i: Int) extends Exception with Product with Serializable
  20. trait TestInstances extends AnyRef

Inherited from AnyRef

Inherited from Any

Ungrouped