-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scala3: re-add
SpecWiring
for Scala 3
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
...stage-testkit-scalatest/src/main/scala-3/izumi/distage/testkit/scalatest/SpecWiring.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
} | ||
} | ||
|
||
} |
File renamed without changes.