diff --git a/distage/distage-testkit-scalatest/src/main/scala-3/izumi/distage/testkit/scalatest/SpecWiring.scala b/distage/distage-testkit-scalatest/src/main/scala-3/izumi/distage/testkit/scalatest/SpecWiring.scala new file mode 100644 index 0000000000..620e618d4e --- /dev/null +++ b/distage/distage-testkit-scalatest/src/main/scala-3/izumi/distage/testkit/scalatest/SpecWiring.scala @@ -0,0 +1,28 @@ +package izumi.distage.testkit.scalatest + +import izumi.distage.framework.{CheckableApp, PlanCheckConfig, PlanCheckMaterializer} +import izumi.distage.modules.DefaultModule + +abstract class SpecWiring[AppMain <: CheckableApp, Cfg <: PlanCheckConfig.Any]( + val app: AppMain, + val cfg: Cfg = PlanCheckConfig.empty, + val checkAgainAtRuntime: Boolean = true, +)(implicit + val planCheck: PlanCheckMaterializer[AppMain, Cfg], + defaultModule: DefaultModule[app.AppEffectType], +) extends Spec1[app.AppEffectType]()(app.tagK, defaultModule) + with WiringAssertions { + + s"Wiring check for `${planCheck.app.getClass.getCanonicalName}`" should { + "Pass at compile-time" in { + assert(planCheck.checkPassed) + } + + if (checkAgainAtRuntime) { + "Pass at runtime" in { + planCheck.checkAgainAtRuntime().throwOnError() + } + } + } + +} diff --git a/distage/distage-testkit-scalatest/src/test/scala-2/izumi/distage/testkit/distagesuite/compiletime/StandaloneWiringTest.scala b/distage/distage-testkit-scalatest/src/test/scala/izumi/distage/testkit/distagesuite/compiletime/StandaloneWiringTest.scala similarity index 100% rename from distage/distage-testkit-scalatest/src/test/scala-2/izumi/distage/testkit/distagesuite/compiletime/StandaloneWiringTest.scala rename to distage/distage-testkit-scalatest/src/test/scala/izumi/distage/testkit/distagesuite/compiletime/StandaloneWiringTest.scala