diff --git a/api/build.gradle.kts b/api/build.gradle.kts index 98e18aa..87c7345 100644 --- a/api/build.gradle.kts +++ b/api/build.gradle.kts @@ -1,6 +1,7 @@ plugins { alias(opensavvyConventions.plugins.base) alias(opensavvyConventions.plugins.kotlin.library) + alias(libsCommon.plugins.testBalloon) } kotlin { @@ -19,8 +20,9 @@ kotlin { } sourceSets.commonTest.dependencies { - implementation(libsCommon.opensavvy.prepared.kotest) + implementation(libsCommon.opensavvy.prepared.testBalloon) implementation(libsCommon.opensavvy.prepared.arrow) + implementation(libsCommon.kotlin.test) } } diff --git a/api/src/commonTest/kotlin/ParametersTest.kt b/api/src/commonTest/kotlin/ParametersTest.kt index 2154694..447e9a4 100644 --- a/api/src/commonTest/kotlin/ParametersTest.kt +++ b/api/src/commonTest/kotlin/ParametersTest.kt @@ -1,8 +1,7 @@ package opensavvy.spine.api -import io.kotest.assertions.throwables.shouldThrow -import io.kotest.matchers.shouldBe import opensavvy.prepared.suite.SuiteDsl +import opensavvy.prepared.suite.assertions.checkThrows fun SuiteDsl.parameters() = suite("Endpoint parameters") { test("Mandatory parameters") { @@ -16,11 +15,9 @@ fun SuiteDsl.parameters() = suite("Endpoint parameters") { } check(params.archived) - shouldThrow { params.private } + checkThrows { params.private } - params.data shouldBe mapOf( - "archived" to "true", - ) + check(params.data == mapOf("archived" to "true")) } test("Optional parameters") { @@ -36,9 +33,7 @@ fun SuiteDsl.parameters() = suite("Endpoint parameters") { check(params.archived == true) check(params.private == null) - params.data shouldBe mapOf( - "archived" to "true", - ) + check(params.data == mapOf("archived" to "true")) } test("Optional parameters with default values") { @@ -54,9 +49,7 @@ fun SuiteDsl.parameters() = suite("Endpoint parameters") { check(params.archived) check(!params.private) - params.data shouldBe mapOf( - "archived" to "true", - ) + check(params.data == mapOf("archived" to "true")) } test("Supported types are mapped correctly") { diff --git a/api/src/commonTest/kotlin/PathTest.kt b/api/src/commonTest/kotlin/PathTest.kt index c78725b..f09c653 100644 --- a/api/src/commonTest/kotlin/PathTest.kt +++ b/api/src/commonTest/kotlin/PathTest.kt @@ -1,7 +1,7 @@ package opensavvy.spine.api -import io.kotest.assertions.throwables.shouldThrow import opensavvy.prepared.suite.SuiteDsl +import opensavvy.prepared.suite.assertions.checkThrows infix fun Addressed.shouldBeAddressedBy(expectedPath: String) { check(this.path.toString() == expectedPath) @@ -14,11 +14,11 @@ fun SuiteDsl.paths() = suite("Paths") { } test("A segment shouldn't be empty") { - shouldThrow { Path.Segment("") } + checkThrows { Path.Segment("") } } test("A segment shouldn't contain one of the forbidden characters") { - shouldThrow { Path.Segment("other/test") } + checkThrows { Path.Segment("other/test") } } test("Valid paths") { diff --git a/api/src/commonTest/kotlin/TypedTests.kt b/api/src/commonTest/kotlin/TypedTests.kt index d58baa2..485ca98 100644 --- a/api/src/commonTest/kotlin/TypedTests.kt +++ b/api/src/commonTest/kotlin/TypedTests.kt @@ -1,12 +1,9 @@ package opensavvy.spine.api -import io.kotest.core.spec.style.StringSpec -import opensavvy.prepared.runner.kotest.preparedSuite +import opensavvy.prepared.runner.testballoon.preparedSuite -class TypedTests : StringSpec({ - preparedSuite { - paths() - parameters() - resolvedRouteTests() - } -}) +val TypedTests by preparedSuite { + paths() + parameters() + resolvedRouteTests() +} diff --git a/client-arrow/build.gradle.kts b/client-arrow/build.gradle.kts index b1912ae..24f19a3 100644 --- a/client-arrow/build.gradle.kts +++ b/client-arrow/build.gradle.kts @@ -1,6 +1,7 @@ plugins { alias(opensavvyConventions.plugins.base) alias(opensavvyConventions.plugins.kotlin.library) + alias(libsCommon.plugins.testBalloon) } kotlin { @@ -21,8 +22,9 @@ kotlin { } sourceSets.commonTest.dependencies { - implementation(libsCommon.opensavvy.prepared.kotest) + implementation(libsCommon.opensavvy.prepared.testBalloon) implementation(libsCommon.opensavvy.prepared.arrow) + implementation(libsCommon.kotlin.test) } sourceSets.all { diff --git a/client/build.gradle.kts b/client/build.gradle.kts index 5e8e121..aa11642 100644 --- a/client/build.gradle.kts +++ b/client/build.gradle.kts @@ -1,6 +1,7 @@ plugins { alias(opensavvyConventions.plugins.base) alias(opensavvyConventions.plugins.kotlin.library) + alias(libsCommon.plugins.testBalloon) } kotlin { @@ -22,8 +23,9 @@ kotlin { } sourceSets.commonTest.dependencies { - implementation(libsCommon.opensavvy.prepared.kotest) + implementation(libsCommon.opensavvy.prepared.testBalloon) implementation(libsCommon.opensavvy.prepared.arrow) + implementation(libsCommon.kotlin.test) } } diff --git a/server-arrow-independent/build.gradle.kts b/server-arrow-independent/build.gradle.kts index 547559b..d67c811 100644 --- a/server-arrow-independent/build.gradle.kts +++ b/server-arrow-independent/build.gradle.kts @@ -2,6 +2,7 @@ plugins { alias(opensavvyConventions.plugins.base) alias(opensavvyConventions.plugins.kotlin.library) alias(libsCommon.plugins.kotlinx.serialization) + alias(libsCommon.plugins.testBalloon) } kotlin { @@ -15,9 +16,10 @@ kotlin { } sourceSets.commonTest.dependencies { - implementation(libsCommon.opensavvy.prepared.kotest) + implementation(libsCommon.opensavvy.prepared.testBalloon) implementation(libsCommon.opensavvy.prepared.arrow) implementation(libsCommon.opensavvy.prepared.ktor) + implementation(libsCommon.kotlin.test) implementation(libs.ktor.server.contentNegotiation) implementation(libs.ktor.client.contentNegotiation) implementation(libs.ktor.kotlinxJson) diff --git a/server-arrow-independent/src/commonTest/kotlin/ServerRaiseTest.kt b/server-arrow-independent/src/commonTest/kotlin/ServerRaiseTest.kt index 8047b0d..af2dd73 100644 --- a/server-arrow-independent/src/commonTest/kotlin/ServerRaiseTest.kt +++ b/server-arrow-independent/src/commonTest/kotlin/ServerRaiseTest.kt @@ -9,11 +9,11 @@ import io.ktor.server.response.* import io.ktor.server.routing.* import opensavvy.prepared.compat.ktor.preparedClient import opensavvy.prepared.compat.ktor.preparedServer -import opensavvy.prepared.runner.kotest.PreparedSpec +import opensavvy.prepared.runner.testballoon.preparedSuite import io.ktor.client.plugins.contentnegotiation.ContentNegotiation as ClientContentNegotiation import io.ktor.server.plugins.contentnegotiation.ContentNegotiation as ServerContentNegotiation -class ServerRaiseTest : PreparedSpec({ +val ServerRaiseTest by preparedSuite { val server by preparedServer { install(ServerContentNegotiation) { @@ -49,4 +49,4 @@ class ServerRaiseTest : PreparedSpec({ check(client().put("/product?first=6&second=2").body() == 12) } -}) +} diff --git a/server-arrow/build.gradle.kts b/server-arrow/build.gradle.kts index 187c6e6..90760ab 100644 --- a/server-arrow/build.gradle.kts +++ b/server-arrow/build.gradle.kts @@ -2,6 +2,7 @@ plugins { alias(opensavvyConventions.plugins.base) alias(opensavvyConventions.plugins.kotlin.library) alias(libsCommon.plugins.kotlinx.serialization) + alias(libsCommon.plugins.testBalloon) } kotlin { @@ -14,9 +15,10 @@ kotlin { } sourceSets.commonTest.dependencies { - implementation(libsCommon.opensavvy.prepared.kotest) + implementation(libsCommon.opensavvy.prepared.testBalloon) implementation(libsCommon.opensavvy.prepared.arrow) implementation(libsCommon.opensavvy.prepared.ktor) + implementation(libsCommon.kotlin.test) implementation(libs.ktor.server.contentNegotiation) implementation(libs.ktor.client.contentNegotiation) implementation(libs.ktor.kotlinxJson) diff --git a/server/build.gradle.kts b/server/build.gradle.kts index 345fc33..9b03f60 100644 --- a/server/build.gradle.kts +++ b/server/build.gradle.kts @@ -2,6 +2,7 @@ plugins { alias(opensavvyConventions.plugins.base) alias(opensavvyConventions.plugins.kotlin.library) alias(libsCommon.plugins.kotlinx.serialization) + alias(libsCommon.plugins.testBalloon) } kotlin { @@ -16,9 +17,10 @@ kotlin { } sourceSets.commonTest.dependencies { - implementation(libsCommon.opensavvy.prepared.kotest) + implementation(libsCommon.opensavvy.prepared.testBalloon) implementation(libsCommon.opensavvy.prepared.arrow) implementation(libsCommon.opensavvy.prepared.ktor) + implementation(libsCommon.kotlin.test) implementation(libs.ktor.server.contentNegotiation) implementation(libs.ktor.client.contentNegotiation) implementation(libs.ktor.kotlinxJson) diff --git a/server/src/commonTest/kotlin/ServerTests.kt b/server/src/commonTest/kotlin/ServerTests.kt index 9fd495c..c00d900 100644 --- a/server/src/commonTest/kotlin/ServerTests.kt +++ b/server/src/commonTest/kotlin/ServerTests.kt @@ -1,10 +1,7 @@ package opensavvy.spine.typed.server -import io.kotest.core.spec.style.StringSpec -import opensavvy.prepared.runner.kotest.preparedSuite +import opensavvy.prepared.runner.testballoon.preparedSuite -class ServerTests : StringSpec({ - preparedSuite { - routeTest() - } -}) +val ServerTests by preparedSuite { + routeTest() +}