From 2a567a18f6778e466048393784634530709d942e Mon Sep 17 00:00:00 2001 From: Xavier Gouchet Date: Fri, 29 Nov 2019 16:29:04 +0100 Subject: [PATCH] :arrow_up: (Core): Switch to Spek2 --- .../src/main/kotlin/fr/xgouchet/buildsrc/Dependencies.kt | 7 +++---- .../kotlin/fr/xgouchet/buildsrc/settings/JUnitConfig.kt | 2 +- core/src/test/kotlin/fr/xgouchet/elmyr/ForgeBooleanSpek.kt | 6 ++---- core/src/test/kotlin/fr/xgouchet/elmyr/ForgeCharSpek.kt | 6 ++---- .../test/kotlin/fr/xgouchet/elmyr/ForgeCollectionSpek.kt | 6 ++---- .../src/test/kotlin/fr/xgouchet/elmyr/ForgeDelegateSpek.kt | 6 ++---- core/src/test/kotlin/fr/xgouchet/elmyr/ForgeDoubleSpek.kt | 6 ++---- core/src/test/kotlin/fr/xgouchet/elmyr/ForgeFactorySpek.kt | 6 ++---- core/src/test/kotlin/fr/xgouchet/elmyr/ForgeFloatSpek.kt | 6 ++---- core/src/test/kotlin/fr/xgouchet/elmyr/ForgeIntSpek.kt | 6 ++---- core/src/test/kotlin/fr/xgouchet/elmyr/ForgeLongSpek.kt | 6 ++---- core/src/test/kotlin/fr/xgouchet/elmyr/ForgeStringSpek.kt | 6 ++---- .../test/kotlin/fr/xgouchet/elmyr/regex/RegexParserSpek.kt | 6 ++---- .../kotlin/fr/xgouchet/elmyr/regex/node/ChildNodeSpek.kt | 6 ++---- 14 files changed, 28 insertions(+), 53 deletions(-) diff --git a/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/Dependencies.kt b/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/Dependencies.kt index 9f92a92..10c678b 100644 --- a/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/Dependencies.kt +++ b/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/Dependencies.kt @@ -12,7 +12,7 @@ object Dependencies { const val JUnitPlatform = "1.5.2" const val JUnitVintage = "5.5.2" - const val Spek = "1.2.1" + const val Spek2 = "2.0.8" const val AssertJ = "0.2.1" const val MockitoKotlin = "2.1.0" const val Jacoco = "0.8.4" @@ -37,9 +37,8 @@ object Dependencies { const val JUnit4 = "junit:junit:${Versions.JUnit4}" @JvmField val Spek = arrayOf( - "org.jetbrains.spek:spek-api:${Versions.Spek}", - "org.jetbrains.spek:spek-subject-extension:${Versions.Spek}", - "org.jetbrains.spek:spek-junit-platform-engine:${Versions.Spek}", + "org.spekframework.spek2:spek-dsl-jvm:${Versions.Spek2}", + "org.spekframework.spek2:spek-runner-junit5:${Versions.Spek2}", "org.jetbrains.kotlin:kotlin-reflect:${Versions.Kotlin}" ) diff --git a/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/settings/JUnitConfig.kt b/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/settings/JUnitConfig.kt index 3ecfdbc..b7e2f5a 100644 --- a/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/settings/JUnitConfig.kt +++ b/buildSrc/src/main/kotlin/fr/xgouchet/buildsrc/settings/JUnitConfig.kt @@ -6,7 +6,7 @@ import org.gradle.api.tasks.testing.Test fun Project.junitConfig() { tasks.withType(Test::class.java) { useJUnitPlatform { - includeEngines("spek", "junit-jupiter", "junit-vintage") + includeEngines("spek2", "junit-jupiter", "junit-vintage") } } } diff --git a/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeBooleanSpek.kt b/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeBooleanSpek.kt index a0f53af..26d2f77 100644 --- a/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeBooleanSpek.kt +++ b/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeBooleanSpek.kt @@ -1,9 +1,7 @@ package fr.xgouchet.elmyr -import org.jetbrains.spek.api.Spek -import org.jetbrains.spek.api.dsl.context -import org.jetbrains.spek.api.dsl.describe -import org.jetbrains.spek.api.dsl.it +import org.spekframework.spek2.Spek +import org.spekframework.spek2.style.specification.describe class ForgeBooleanSpek : Spek({ diff --git a/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeCharSpek.kt b/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeCharSpek.kt index 21074ab..1c8d07c 100644 --- a/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeCharSpek.kt +++ b/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeCharSpek.kt @@ -1,10 +1,8 @@ package fr.xgouchet.elmyr import org.assertj.core.api.Assertions.assertThat -import org.jetbrains.spek.api.Spek -import org.jetbrains.spek.api.dsl.context -import org.jetbrains.spek.api.dsl.describe -import org.jetbrains.spek.api.dsl.it +import org.spekframework.spek2.Spek +import org.spekframework.spek2.style.specification.describe class ForgeCharSpek : Spek({ diff --git a/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeCollectionSpek.kt b/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeCollectionSpek.kt index 325c236..e0031ba 100644 --- a/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeCollectionSpek.kt +++ b/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeCollectionSpek.kt @@ -2,10 +2,8 @@ package fr.xgouchet.elmyr import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.KotlinAssertions.assertThat as assertThatK -import org.jetbrains.spek.api.Spek -import org.jetbrains.spek.api.dsl.context -import org.jetbrains.spek.api.dsl.describe -import org.jetbrains.spek.api.dsl.it +import org.spekframework.spek2.Spek +import org.spekframework.spek2.style.specification.describe class ForgeCollectionSpek : Spek({ diff --git a/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeDelegateSpek.kt b/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeDelegateSpek.kt index 28f581a..981efdb 100644 --- a/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeDelegateSpek.kt +++ b/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeDelegateSpek.kt @@ -10,10 +10,8 @@ import fr.xgouchet.elmyr.kotlin.booleanForgery import fr.xgouchet.elmyr.kotlin.factoryForgery import fr.xgouchet.elmyr.kotlin.nullableForgery import org.assertj.core.api.Assertions.assertThat -import org.jetbrains.spek.api.Spek -import org.jetbrains.spek.api.dsl.context -import org.jetbrains.spek.api.dsl.describe -import org.jetbrains.spek.api.dsl.it +import org.spekframework.spek2.Spek +import org.spekframework.spek2.style.specification.describe class ForgeDelegateSpek : Spek({ diff --git a/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeDoubleSpek.kt b/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeDoubleSpek.kt index 5f3a3e2..92b6bff 100644 --- a/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeDoubleSpek.kt +++ b/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeDoubleSpek.kt @@ -1,10 +1,8 @@ package fr.xgouchet.elmyr import org.assertj.core.api.Assertions.assertThat -import org.jetbrains.spek.api.Spek -import org.jetbrains.spek.api.dsl.context -import org.jetbrains.spek.api.dsl.describe -import org.jetbrains.spek.api.dsl.it +import org.spekframework.spek2.Spek +import org.spekframework.spek2.style.specification.describe class ForgeDoubleSpek : Spek({ diff --git a/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeFactorySpek.kt b/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeFactorySpek.kt index 7aea9a5..d6b6f43 100644 --- a/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeFactorySpek.kt +++ b/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeFactorySpek.kt @@ -8,10 +8,8 @@ import fr.xgouchet.elmyr.dummy.Bar import fr.xgouchet.elmyr.dummy.Foo import fr.xgouchet.elmyr.dummy.Food import org.assertj.core.api.Assertions.assertThat -import org.jetbrains.spek.api.Spek -import org.jetbrains.spek.api.dsl.context -import org.jetbrains.spek.api.dsl.describe -import org.jetbrains.spek.api.dsl.it +import org.spekframework.spek2.Spek +import org.spekframework.spek2.style.specification.describe class ForgeFactorySpek : Spek({ diff --git a/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeFloatSpek.kt b/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeFloatSpek.kt index a210fa5..d7b0868 100644 --- a/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeFloatSpek.kt +++ b/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeFloatSpek.kt @@ -1,10 +1,8 @@ package fr.xgouchet.elmyr import org.assertj.core.api.Assertions.assertThat -import org.jetbrains.spek.api.Spek -import org.jetbrains.spek.api.dsl.context -import org.jetbrains.spek.api.dsl.describe -import org.jetbrains.spek.api.dsl.it +import org.spekframework.spek2.Spek +import org.spekframework.spek2.style.specification.describe class ForgeFloatSpek : Spek({ diff --git a/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeIntSpek.kt b/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeIntSpek.kt index 1858466..6649f03 100644 --- a/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeIntSpek.kt +++ b/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeIntSpek.kt @@ -1,10 +1,8 @@ package fr.xgouchet.elmyr import org.assertj.core.api.Assertions.assertThat -import org.jetbrains.spek.api.Spek -import org.jetbrains.spek.api.dsl.context -import org.jetbrains.spek.api.dsl.describe -import org.jetbrains.spek.api.dsl.it +import org.spekframework.spek2.Spek +import org.spekframework.spek2.style.specification.describe class ForgeIntSpek : Spek({ diff --git a/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeLongSpek.kt b/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeLongSpek.kt index 635f6a1..1c44983 100644 --- a/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeLongSpek.kt +++ b/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeLongSpek.kt @@ -1,10 +1,8 @@ package fr.xgouchet.elmyr import org.assertj.core.api.Assertions.assertThat -import org.jetbrains.spek.api.Spek -import org.jetbrains.spek.api.dsl.context -import org.jetbrains.spek.api.dsl.describe -import org.jetbrains.spek.api.dsl.it +import org.spekframework.spek2.Spek +import org.spekframework.spek2.style.specification.describe class ForgeLongSpek : Spek({ diff --git a/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeStringSpek.kt b/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeStringSpek.kt index d77379a..f1e532f 100644 --- a/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeStringSpek.kt +++ b/core/src/test/kotlin/fr/xgouchet/elmyr/ForgeStringSpek.kt @@ -1,10 +1,8 @@ package fr.xgouchet.elmyr import org.assertj.core.api.Assertions.assertThat -import org.jetbrains.spek.api.Spek -import org.jetbrains.spek.api.dsl.context -import org.jetbrains.spek.api.dsl.describe -import org.jetbrains.spek.api.dsl.it +import org.spekframework.spek2.Spek +import org.spekframework.spek2.style.specification.describe class ForgeStringSpek : Spek({ diff --git a/core/src/test/kotlin/fr/xgouchet/elmyr/regex/RegexParserSpek.kt b/core/src/test/kotlin/fr/xgouchet/elmyr/regex/RegexParserSpek.kt index d63b18a..75996ac 100644 --- a/core/src/test/kotlin/fr/xgouchet/elmyr/regex/RegexParserSpek.kt +++ b/core/src/test/kotlin/fr/xgouchet/elmyr/regex/RegexParserSpek.kt @@ -3,10 +3,8 @@ package fr.xgouchet.elmyr.regex import fr.xgouchet.elmyr.Forge import fr.xgouchet.elmyr.throws import org.assertj.core.api.Assertions.assertThat -import org.jetbrains.spek.api.Spek -import org.jetbrains.spek.api.dsl.context -import org.jetbrains.spek.api.dsl.describe -import org.jetbrains.spek.api.dsl.it +import org.spekframework.spek2.Spek +import org.spekframework.spek2.style.specification.describe class RegexParserSpek : Spek({ describe("A regex parser") { diff --git a/core/src/test/kotlin/fr/xgouchet/elmyr/regex/node/ChildNodeSpek.kt b/core/src/test/kotlin/fr/xgouchet/elmyr/regex/node/ChildNodeSpek.kt index 36c238f..e3e090a 100644 --- a/core/src/test/kotlin/fr/xgouchet/elmyr/regex/node/ChildNodeSpek.kt +++ b/core/src/test/kotlin/fr/xgouchet/elmyr/regex/node/ChildNodeSpek.kt @@ -2,10 +2,8 @@ package fr.xgouchet.elmyr.regex.node import fr.xgouchet.elmyr.Forge import org.assertj.core.api.Assertions.assertThat -import org.jetbrains.spek.api.Spek -import org.jetbrains.spek.api.dsl.context -import org.jetbrains.spek.api.dsl.describe -import org.jetbrains.spek.api.dsl.it +import org.spekframework.spek2.Spek +import org.spekframework.spek2.style.specification.describe /** * @author Xavier F. Gouchet