dave08
02/17/2025, 2:48 PMdave08
02/17/2025, 2:49 PMclass PopularGroupTypeSpec : PreparedSpec({
val runAndAssert: suspend (ListQuery<CollectionItemId>, expected: String) -> Unit = { query, expected ->
expectThat(query.dryRunOrThrow()).isSqlEqualTo(expected)
}
popularGroupSuite(runAndAssert)
})
dave08
02/17/2025, 2:50 PMCLOVIS
02/17/2025, 6:37 PMa prepared val that can take parameters when called?How do you envision this? The point of Prepared is that the value is "bound" to the test and cannot change. Which case do you want? If you want a bunch of values that are each bound, I guess you could to that with a
Map<YourThing, Prepared<…>>
CLOVIS
02/17/2025, 6:41 PMAlso is there any way to disable a whole PreparedSpecMaybe something like this works? 👀
class Foo : PreparedSpec({
return@PreparedSpec // stop it
…
})
else, you can
class Foo : PreparedSpec({
suite("All the tests", Ignored) {
// …all your tests…
}
})
If you want, you can create an issue for configuring the tests at the spec level, and I'll add
class Foo : PreparedSpec(Ignored, {
// …
})
dave08
02/18/2025, 10:21 AMCLOVIS
02/18/2025, 1:24 PMrunAndAssert
is for. Typically, the way to reuse test suites for multiple implementations is to write a suite that accepts a Prepared<TheThingToTest>
dave08
02/18/2025, 1:26 PMCLOVIS
02/18/2025, 1:33 PMsuspend TestDsl.() -> Unit
lambda, this way it can use prepared values