Skip to content

Bump kotest from 6.0.0.M1 to 6.0.0.M2 #249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
kotlin = "2.1.0"
kotest = "6.0.0.M1"
kotest = "6.0.0.M2"
detekt = "1.23.7"
ktlint = "1.1.0"
okio = "3.10.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import io.github.optimumcode.json.schema.ValidationError
import io.github.optimumcode.json.schema.model.AbstractElement
import io.github.optimumcode.json.schema.model.PrimitiveElement
import io.kotest.assertions.assertSoftly
import io.kotest.assertions.throwables.shouldNotThrowAny
import io.kotest.assertions.throwables.shouldNotThrowAnyUnit
import io.kotest.assertions.throwables.shouldThrow
import io.kotest.assertions.withClue
Expand Down Expand Up @@ -315,31 +314,29 @@ class JsonSchemaLoaderTest : FunSpec() {
// https://github.com/OptimumCode/json-schema-validator/issues/87
test("BUG_87 relative uri-ref in root \$id causes incorrect reference resolution for root schema") {
val schema =
shouldNotThrowAny {
JsonSchemaLoader.create()
.register(
"""
{
JsonSchemaLoader.create()
.register(
"""
{
"${'$'}schema": "https://json-schema.org/draft/2020-12/schema",
"${'$'}id": "myproject/enums/foo",
"type": "integer"
}
""".trimIndent(),
).fromDefinition(
"""
{
"${'$'}schema": "https://json-schema.org/draft/2020-12/schema",
"${'$'}id": "myproject/enums/foo",
"type": "integer"
}
""".trimIndent(),
).fromDefinition(
"""
{
"${'$'}schema": "https://json-schema.org/draft/2020-12/schema",
"${'$'}id": "myproject/data/request",
"type": "object",
"properties": {
"foobar": {
"${'$'}ref": "/myproject/enums/foo"
}
}
}
""".trimIndent(),
)
}
"${'$'}id": "myproject/data/request",
"type": "object",
"properties": {
"foobar": {
"${'$'}ref": "/myproject/enums/foo"
}
}
}
""".trimIndent(),
)

val errors = mutableListOf<ValidationError>()
val valid =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import io.github.optimumcode.json.schema.ValidationError
import io.github.optimumcode.json.schema.model.AbstractElement
import io.github.optimumcode.json.schema.model.PrimitiveElement
import io.kotest.assertions.assertSoftly
import io.kotest.assertions.throwables.shouldNotThrowAny
import io.kotest.assertions.throwables.shouldThrow
import io.kotest.assertions.withClue
import io.kotest.core.spec.style.FunSpec
Expand Down Expand Up @@ -98,23 +97,19 @@ class JsonSchemaExtensionTest : FunSpec() {

test("registers all extensions with varargs") {
val schema =
shouldNotThrowAny {
JsonSchemaLoader
.create()
.withExtensions(SimpleTimeFormatAssertionFactory, SimpleDateFormatAssertionFactory)
.fromDefinition(schemaDef)
}
JsonSchemaLoader
.create()
.withExtensions(SimpleTimeFormatAssertionFactory, SimpleDateFormatAssertionFactory)
.fromDefinition(schemaDef)
checkValidAndInvalid(schema)
}

test("registers all extensions with iterable") {
val schema =
shouldNotThrowAny {
JsonSchemaLoader
.create()
.withExtensions(listOf(SimpleTimeFormatAssertionFactory, SimpleDateFormatAssertionFactory))
.fromDefinition(schemaDef)
}
JsonSchemaLoader
.create()
.withExtensions(listOf(SimpleTimeFormatAssertionFactory, SimpleDateFormatAssertionFactory))
.fromDefinition(schemaDef)
checkValidAndInvalid(schema)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import io.github.optimumcode.json.schema.JsonSchema
import io.github.optimumcode.json.schema.JsonSchemaLoader
import io.github.optimumcode.json.schema.SchemaOption
import io.github.optimumcode.json.schema.SchemaType
import io.kotest.assertions.throwables.shouldNotThrowAny
import io.kotest.assertions.withClue
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe
Expand Down Expand Up @@ -235,12 +234,8 @@ private fun FunSpec.executeFromDirectory(
test("$testSuiteID at index $testSuiteIndex test $testIndex") {
withClue(listOf(testSuite.description, testSuite.schema, test.description, test.data)) {
val schema: JsonSchema =
shouldNotThrowAny {
schemaLoader.fromJsonElement(testSuite.schema, schemaType)
}
shouldNotThrowAny {
schema.validate(test.data, ErrorCollector.EMPTY)
} shouldBe test.valid
schemaLoader.fromJsonElement(testSuite.schema, schemaType)
schema.validate(test.data, ErrorCollector.EMPTY) shouldBe test.valid
}
}
}
Expand Down
Loading