Skip to content

Commit e472062

Browse files
committed
build: Update testing dependencies
1 parent f499baf commit e472062

File tree

3 files changed

+28
-25
lines changed

3 files changed

+28
-25
lines changed

buildSrc/src/main/kotlin/kotlin-convention.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ dependencies {
4343
compileOnly(kotlin("stdlib-jdk8"))
4444
testImplementation(kotlin("stdlib-jdk8"))
4545
testImplementation(kotlin("test-junit5"))
46-
testImplementation(platform("org.junit:junit-bom:5.8.1"))
46+
testImplementation(platform("org.junit:junit-bom:5.9.0"))
4747
testImplementation("org.junit.jupiter:junit-jupiter")
48-
testImplementation("io.mockk:mockk:1.12.0")
48+
testImplementation("io.mockk:mockk:1.12.7")
4949

50-
val kotestVersion = "5.0.0.M3"
50+
val kotestVersion = "5.4.2"
5151
testImplementation("io.kotest:kotest-runner-junit5:$kotestVersion")
5252
testImplementation("io.kotest:kotest-framework-datatest:$kotestVersion")
5353
testImplementation("io.kotest:kotest-assertions-core:$kotestVersion")

core/src/test/kotlin/internal/data/ConfigParsingTest.kt

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,25 @@ internal class ConfigParsingTest : FeatureSpec({
3131

3232
feature("parseSlotPositions") {
3333

34-
scenario("valid data") {
35-
withData(
36-
nameFn = { (value, range) -> "$value -> $range" },
37-
"42" to 42..42,
38-
"0-0" to 0..0,
39-
"9-17" to 9..17,
40-
"0-53" to 0..53,
41-
) { (value, range) -> parseSlotPositions(value) shouldBe range }
42-
}
34+
// Valid data
35+
withData(
36+
nameFn = { (value, range) -> "$value -> $range" },
37+
"42" to 42..42,
38+
"0-0" to 0..0,
39+
"9-17" to 9..17,
40+
"0-53" to 0..53,
41+
) { (value, range) -> parseSlotPositions(value) shouldBe range }
4342

44-
scenario("not valid data") {
45-
withData(
46-
nameFn = { "'$it' is not valid range" },
47-
"",
48-
"-1",
49-
"54",
50-
"4-2",
51-
"0-54",
52-
"0..2",
53-
"word",
54-
) { value -> shouldThrow<IllegalArgumentException> { parseSlotPositions(value) } }
55-
}
43+
// Not valid data
44+
withData(
45+
nameFn = { "'$it' is not valid range" },
46+
"",
47+
"-1",
48+
"54",
49+
"4-2",
50+
"0-54",
51+
"0..2",
52+
"word",
53+
) { value -> shouldThrow<IllegalArgumentException> { parseSlotPositions(value) } }
5654
}
5755
})

core/src/test/kotlin/test/Inventory.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,13 @@ fun Inventory(
3737
val contents = Array(size) { AIR }
3838
return mockk(relaxUnitFun = true) {
3939
every { getSize() } returns size
40-
every { getHolder() } answers { holder ?: InventoryHolder { this@mockk } }
40+
every { getHolder() } answers { holder ?: SimpleInventoryHolder(this@mockk) }
4141
every { getItem(any()) } answers { contents[firstArg()] }
4242
every { setItem(any(), any()) } answers { contents[firstArg()] = secondArg() }
4343
}
4444
}
45+
46+
// Required because of the issue: https://github.com/mockk/mockk/issues/868
47+
private class SimpleInventoryHolder(private val inventory: Inventory) : InventoryHolder {
48+
override fun getInventory(): Inventory = inventory
49+
}

0 commit comments

Comments
 (0)