Skip to content

Commit

Permalink
🚑️ Remove accidental StackOverflow on beforeSpec (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoColman authored Jun 23, 2023
1 parent 223a2c2 commit 6ef6af8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ class JdbcDatabaseContainerExtension(
}

override suspend fun beforeTest(testCase: TestCase) {
beforeTest(testCase, dataSource ?: error("Datasource not initialized"))
beforeTest.invoke(testCase, dataSource ?: error("Datasource not initialized"))
}

override suspend fun afterTest(testCase: TestCase, result: TestResult) {
afterTest(testCase, dataSource ?: error("Datasource not initialized"))
afterTest.invoke(testCase, dataSource ?: error("Datasource not initialized"))
}

override suspend fun beforeSpec(spec: Spec) {
beforeSpec(spec)
beforeSpec.invoke(spec)
}

override suspend fun afterSpec(spec: Spec) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ private val mysql = MySQLContainer<Nothing>("mysql:8.0.26").apply {
withUrlParam("zeroDateTimeBehavior", "convertToNull")
}

private val ext = SharedJdbcDatabaseContainerExtension(mysql) {
maximumPoolSize = 8
minimumIdle = 4
}
private val ext = JdbcDatabaseContainerExtension(mysql)

class SharedJdbcTestContainerExtensionSpecTest1 : FunSpec() {
init {

val ds = install(ext)
val ds = install(ext) {
maximumPoolSize = 8
minimumIdle = 4
}

test("should initialize once per module") {
ds.connection.use {
Expand Down

0 comments on commit 6ef6af8

Please sign in to comment.