Skip to content

Commit

Permalink
scala3: re-add SpecWiring for Scala 3
Browse files Browse the repository at this point in the history
  • Loading branch information
neko-kai committed Oct 13, 2022
1 parent 411232d commit 1a56e64
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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()
}
}
}

}

0 comments on commit 1a56e64

Please sign in to comment.