Skip to content

Commit

Permalink
Use shouldThrow
Browse files Browse the repository at this point in the history
  • Loading branch information
krzema12 committed Dec 31, 2024
1 parent 7c1f7e8 commit 1faf96c
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package it.krzeminski.snakeyaml.engine.kmp.issues.issue54

import io.kotest.assertions.fail
import io.kotest.assertions.throwables.shouldThrow
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.nulls.shouldNotBeNull
import io.kotest.matchers.shouldBe
import io.kotest.matchers.shouldNotBe
import io.kotest.matchers.string.shouldContain
import it.krzeminski.snakeyaml.engine.kmp.api.Dump
import it.krzeminski.snakeyaml.engine.kmp.api.DumpSettings
Expand All @@ -22,17 +21,16 @@ class DumpWithoutSpaceTest : FunSpec({
}

test("The document does not have a space after the *1 alias") {
try {
shouldThrow<Exception> {
parse(
"""|--- &1
|hash:
| :one: true
| :two: true
| *1: true""".trimMargin()
)
fail("Shouldn't reach here!")
} catch (e: Exception) {
e.message shouldContain "could not find expected ':'"
}.also {
it.message shouldContain "could not find expected ':'"
}
}

Expand Down

0 comments on commit 1faf96c

Please sign in to comment.