izumi.distage.testkit.scalatest
package izumi.distage.testkit.scalatest
Members list
Concise view
Type members
Classlikes
trait AssertCIO
scalatest assertion macro for any izumi.functional.bio.IO2
scalatest assertion macro for any izumi.functional.bio.IO2
Attributes
- Companion:
- object
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
object AssertIO2
scalatest assertion macro for any izumi.functional.bio.IO3
scalatest assertion macro for any izumi.functional.bio.IO3
Attributes
- Companion:
- object
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
object AssertIO3
scalatest assertion macro for any cats.effect.kernel.Sync
scalatest assertion macro for any cats.effect.kernel.Sync
Attributes
- Companion:
- object
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
object AssertSync
Attributes
- Companion:
- trait
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Self type
- AssertSync.type
trait AssertZIO
abstract class Spec1[F[_]] extends DistageScalatestTestSuiteRunner[F] with DistageAbstractScalatestSpec[F]
Attributes
- Graph
- Supertypes
- trait DistageAbstractScalatestSpec[F]trait WithSingletonTestRegistration[F]trait DistageTestEnvtrait CanVerbtrait MustVerbtrait ShouldVerbclass DistageScalatestTestSuiteRunner[F]trait AbstractDistageSpec[F]trait TestRegistration[F]trait TestConfigurationtrait TestSuitetrait Suitetrait Serializabletrait Assertionstrait TripleEqualstrait TripleEqualsSupportclass Objecttrait Matchableclass Any
- Known subtypes
- class SpecIdentity
abstract class Spec2[F[_, _]](implicit evidence$1: DefaultModule2[F], val tagBIO: Tag[F]) extends DistageScalatestTestSuiteRunner[[_] =>> F[Throwable, _$3]] with DistageAbstractScalatestSpec[[_] =>> F[Throwable, _$4]]
Attributes
- Graph
- Supertypes
- trait DistageTestEnvtrait CanVerbtrait MustVerbtrait ShouldVerbtrait AbstractDistageSpec[[_] =>> F[Throwable, _$4]]trait TestRegistration[[_] =>> F[Throwable, _$4]]trait TestConfigurationtrait TestSuitetrait Suitetrait Serializabletrait Assertionstrait TripleEqualstrait TripleEqualsSupportclass Objecttrait Matchableclass Any
abstract class Spec3[FR[_, _, _]](implicit evidence$1: DefaultModule3[FR], val tagBIO3: Tag[FR], val tagBIO: Tag[[_, _] =>> FR[Any, _$4, _$5]]) extends DistageScalatestTestSuiteRunner[[_] =>> FR[Any, Throwable, _$6]] with DistageAbstractScalatestSpec[[_] =>> FR[Any, Throwable, _$7]]
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]]
}
type PetStoreEnv = Has[PetStore[IO]]
type PetsEnv = Has[Pets[IO]]
val store = new PetStore[ZIO[PetStoreEnv, _, _]] {
def purchasePet(name: String, cost: Int): RIO[PetStoreEnv, Boolean] = ZIO.accessM(_.get.purchasePet(name, cost))
}
val pets = new Pets[ZIO[PetsEnv, _, _]] {
def myPets: RIO[PetsEnv, List[String]] = ZIO.accessM(_.get.myPets)
}
"test purchase pets" in {
for {
_ <- store.purchasePet("Zab", 213)
pets <- pets.myPets
_ <- assertIO(pets.contains("Zab"))
} yield ()
// : ZIO[PetStoreEnv with PetsEnv, 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", 213)
pets <- pets.myPets
_ <- assertIO(pets.contains("Zab"))
} yield ()
// : ZIO[PetsEnv, Throwable, Unit]
}
Attributes
- Graph
- Supertypes
- trait DistageTestEnvtrait CanVerbtrait MustVerbtrait ShouldVerbtrait AbstractDistageSpec[[_] =>> FR[Any, Throwable, _$7]]trait TestRegistration[[_] =>> FR[Any, Throwable, _$7]]trait TestConfigurationtrait TestSuitetrait Suitetrait Serializabletrait Assertionstrait TripleEqualstrait TripleEqualsSupportclass Objecttrait Matchableclass Any
Attributes
- Graph
- Supertypes
- class Spec1[Identity]trait DistageAbstractScalatestSpec[Identity]trait WithSingletonTestRegistration[Identity]trait DistageTestEnvtrait CanVerbtrait MustVerbtrait ShouldVerbclass DistageScalatestTestSuiteRunner[Identity]trait AbstractDistageSpec[Identity]trait TestRegistration[Identity]trait TestConfigurationtrait TestSuitetrait Suitetrait Serializabletrait Assertionstrait TripleEqualstrait TripleEqualsSupportclass Objecttrait Matchableclass Any
abstract class SpecWiring[F[_], AppMain <: CheckableApp { type AppEffectType = F; }, Cfg <: Any](val app: AppMain, val cfg: Cfg, val checkAgainAtRuntime: Boolean)(implicit val planCheck: PlanCheckMaterializer[AppMain, Cfg], defaultModule: DefaultModule[F]) extends Spec1[F] with WiringAssertions
Attributes
- Graph
- Supertypes
- trait WiringAssertionsclass Spec1[F]trait DistageAbstractScalatestSpec[F]trait WithSingletonTestRegistration[F]trait DistageTestEnvtrait CanVerbtrait MustVerbtrait ShouldVerbclass DistageScalatestTestSuiteRunner[F]trait AbstractDistageSpec[F]trait TestRegistration[F]trait TestConfigurationtrait TestSuitetrait Suitetrait Serializabletrait Assertionstrait TripleEqualstrait TripleEqualsSupportclass Objecttrait Matchableclass Any
trait WiringAssertions
Attributes
- Graph
- Supertypes
- class Objecttrait Matchableclass Any
- Known subtypes
- Self type
- Assertions