Skip to content

Commit 3c47cab

Browse files
committed
Give KotlinTest a try
1 parent 73769c1 commit 3c47cab

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
build
55
src/**/*.txt
66
local.properties
7+
/.kotlintest/

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dependencies {
1313

1414
testImplementation("org.junit.jupiter:junit-jupiter:5.11.4")
1515
testImplementation("org.junit.jupiter:junit-jupiter-params:5.11.4")
16+
testImplementation("io.kotlintest:kotlintest-runner-junit5:3.4.2")
1617
testImplementation("org.assertj:assertj-core:3.27.2")
1718
testImplementation("com.github.stefanbirkner:system-lambda:1.2.1")
1819
}
Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
package de.ronny_h.extensions
22

3-
import org.assertj.core.api.Assertions.assertThat
4-
import org.junit.jupiter.api.Test
3+
import io.kotlintest.shouldBe
4+
import io.kotlintest.specs.StringSpec
55

6-
class SymmetriesTest {
6+
class SymmetriesTest : StringSpec({
77

8-
@Test
9-
fun `an empty list is symmetrical`() {
10-
assertThat(listOf<Int>().isSymmetrical()).isTrue()
8+
"an empty list is symmetrical" {
9+
listOf<Int>().isSymmetrical() shouldBe true
1110
}
1211

13-
@Test
14-
fun `a symmetrical list is symmetrical`() {
15-
assertThat(listOf(1, 2, 3, 2, 1).isSymmetrical()).isTrue()
12+
"a symmetrical list is symmetrical" {
13+
listOf(1, 2, 3, 2, 1).isSymmetrical() shouldBe true
1614
}
1715

18-
@Test
19-
fun `a asymmetrical list is not symmetrical`() {
20-
assertThat(listOf(4, 2, 3, 2, 1).isSymmetrical()).isFalse()
16+
"a asymmetrical list is not symmetrical" {
17+
listOf(4, 2, 3, 2, 1).isSymmetrical() shouldBe false
2118
}
22-
}
19+
})

0 commit comments

Comments
 (0)