Packages

package scalatest

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Type Members

  1. trait AssertCIO extends AnyRef

    scalatest assertion macro for cats.effect.IO

  2. trait AssertIO2[F[+_, +_]] extends AnyRef

    scalatest assertion macro for any izumi.functional.bio.IO2

  3. trait AssertSync[F[_]] extends AnyRef

    scalatest assertion macro for any cats.effect.kernel.Sync

  4. trait AssertZIO extends AnyRef

    scalatest assertion macro for zio.ZIO

  5. abstract class Spec1[F[_]] extends DistageScalatestTestSuiteRunner[F] with DistageAbstractScalatestSpec[F]
  6. abstract class Spec2[F[+_, +_]] extends DistageScalatestTestSuiteRunner[[β$0$]F[Throwable, β$0$]] with DistageAbstractScalatestSpec[[β$1$]F[Throwable, β$1$]]
  7. abstract class SpecIdentity extends Spec1[Identity]
  8. abstract class SpecWiring[AppMain <: CheckableApp, Cfg <: Any] extends Spec1[scalatest.SpecWiring.AppMain.AppEffectType] with WiringAssertions
  9. abstract class SpecZIO extends DistageScalatestTestSuiteRunner[[γ$0$]ZIO[Any, Throwable, γ$0$]] with DistageAbstractScalatestSpec[[γ$1$]ZIO[Any, Throwable, γ$1$]]

    Allows summoning objects from DI in tests via ZIO environment intersection types

    Allows summoning objects from DI in tests via ZIO environment intersection types

    trait PetStore[F[_, _]] {
      def purchasePet(name: String, cost: Int): F[Throwable, Boolean]
    }
    
    trait Pets[F[_, _]]
      def myPets: F[Throwable, List[String]]
    }
    
    val store = new PetStore[ZIO[PetStore[IO], _, _]] {
      def purchasePet(name: String, cost: Int): RIO[PetStore[IO], Boolean] = ZIO.accessM(_.get.purchasePet(name, cost))
    }
    val pets = new Pets[ZIO[Pets[IO], _, _]] {
      def myPets: RIO[Pets[IO], List[String]] = ZIO.accessM(_.get.myPets)
    }
    
    "test purchase pets" in {
      for {
        _    <- store.purchasePet("Zab", 213)
        pets <- pets.myPets
        _    <- assertIO(pets.contains("Zab"))
      } yield ()
      // : ZIO[PetStore[IO] with Pets[IO], Throwable, Unit]
    }

    Lambda parameters and environment may both be used at the same time to define dependencies:

    "test purchase pets" in {
      (store: PetStore[IO]) =>
        for {
          _    <- store.purchasePet("Zab", cost = 213)
          pets <- pets.myPets
          _    <- assertIO(pets.contains("Zab"))
        } yield ()
        // : ZIO[PetsEnv, Throwable, Unit]
    }
  10. trait WiringAssertions extends AnyRef

Value Members

  1. object AssertCIO extends AssertCIO
  2. object AssertIO2
  3. object AssertSync
  4. object AssertZIO extends AssertZIO

Ungrouped