izumi.distage.testkit.scalatest

Members list

Concise view

Type members

Classlikes

trait AssertCIO

scalatest assertion macro for cats.effect.IO

scalatest assertion macro for cats.effect.IO

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object AssertCIO.type
object AssertCIO extends AssertCIO

Attributes

Companion:
trait
Graph
Supertypes
trait AssertCIO
class Object
trait Matchable
class Any
Self type
trait AssertIO2[F[_, _]]

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

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

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object AssertIO2

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait AssertIO3[F[_, _, _]]

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

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

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object AssertIO3

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait AssertSync[F[_]]

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

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

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object AssertSync

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait AssertZIO

scalatest assertion macro for zio.ZIO

scalatest assertion macro for zio.ZIO

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object AssertZIO.type
object AssertZIO extends AssertZIO

Attributes

Companion:
trait
Graph
Supertypes
trait AssertZIO
class Object
trait Matchable
class Any
Self type

Attributes

Graph
Supertypes
trait DistageTestEnv
trait CanVerb
trait MustVerb
trait ShouldVerb
trait AbstractDistageSpec[F]
trait TestRegistration[F]
trait TestConfiguration
trait TestSuite
trait Suite
trait Serializable
trait Assertions
trait TripleEquals
trait TripleEqualsSupport
class Object
trait Matchable
class Any
Known subtypes
class SpecWiring[F, AppMain, Cfg]
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 DistageAbstractScalatestSpec[[_] =>> F[Throwable, _$4]]
trait WithSingletonTestRegistration[[_] =>> F[Throwable, _$4]]
trait DistageTestEnv
trait CanVerb
trait MustVerb
trait ShouldVerb
class DistageScalatestTestSuiteRunner[[_] =>> F[Throwable, _$3]]
trait AbstractDistageSpec[[_] =>> F[Throwable, _$4]]
trait TestRegistration[[_] =>> F[Throwable, _$4]]
trait TestConfiguration
trait TestSuite
trait Suite
trait Serializable
trait Assertions
trait TripleEquals
trait TripleEqualsSupport
class Object
trait Matchable
class 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 DistageAbstractScalatestSpec[[_] =>> FR[Any, Throwable, _$7]]
trait WithSingletonTestRegistration[[_] =>> FR[Any, Throwable, _$7]]
trait DistageTestEnv
trait CanVerb
trait MustVerb
trait ShouldVerb
class DistageScalatestTestSuiteRunner[[_] =>> FR[Any, Throwable, _$6]]
trait AbstractDistageSpec[[_] =>> FR[Any, Throwable, _$7]]
trait TestRegistration[[_] =>> FR[Any, Throwable, _$7]]
trait TestConfiguration
trait TestSuite
trait Suite
trait Serializable
trait Assertions
trait TripleEquals
trait TripleEqualsSupport
class Object
trait Matchable
class Any
abstract class SpecIdentity extends Spec1[Identity]

Attributes

Graph
Supertypes
class Spec1[Identity]
trait DistageTestEnv
trait CanVerb
trait MustVerb
trait ShouldVerb
trait AbstractDistageSpec[Identity]
trait TestRegistration[Identity]
trait TestConfiguration
trait TestSuite
trait Suite
trait Serializable
trait Assertions
trait TripleEquals
trait TripleEqualsSupport
class Object
trait Matchable
class 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
class Spec1[F]
trait DistageTestEnv
trait CanVerb
trait MustVerb
trait ShouldVerb
trait AbstractDistageSpec[F]
trait TestRegistration[F]
trait TestConfiguration
trait TestSuite
trait Suite
trait Serializable
trait Assertions
trait TripleEquals
trait TripleEqualsSupport
class Object
trait Matchable
class Any

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class SpecWiring[F, AppMain, Cfg]
Self type
Assertions