File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed
action-binding-generator/src/test/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 11package io.github.typesafegithub.workflows.actionbindinggenerator
22
33import io.github.typesafegithub.workflows.actionbindinggenerator.generation.ActionBinding
4- import io.kotest.assertions.fail
4+ import io.kotest.matchers.Matcher.Companion.failure
55import io.kotest.matchers.shouldBe
66import java.nio.file.Paths
77
@@ -27,10 +27,11 @@ fun List<ActionBinding>.shouldContainAndMatchFile(path: String) {
2727 actualContent shouldBe expectedContent
2828 } else if (actualContent != expectedContent) {
2929 file.writeText(actualContent)
30- fail(
31- " The binding's Kotlin code in ${file.name} doesn't match the expected one.\n " +
32- " The file has been updated to match what's expected." ,
33- )
30+ actualContent shouldBe
31+ failure<Nothing >(
32+ " The binding's Kotlin code in ${file.name} doesn't match the expected one.\n " +
33+ " The file has been updated to match what's expected." ,
34+ )
3435 }
3536}
3637
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import io.github.typesafegithub.workflows.actionbindinggenerator.typing.IntegerW
1616import io.github.typesafegithub.workflows.actionbindinggenerator.typing.ListOfTypings
1717import io.github.typesafegithub.workflows.actionbindinggenerator.typing.StringTyping
1818import io.github.typesafegithub.workflows.actionbindinggenerator.typing.Typing
19+ import io.kotest.assertions.assertSoftly
1920import io.kotest.core.spec.style.FunSpec
2021import io.kotest.matchers.collections.shouldHaveSize
2122
@@ -221,8 +222,10 @@ class GenerationTest :
221222 )
222223
223224 // then
224- binding.shouldContainAndMatchFile(" ActionWithAllTypesOfInputs.kt" )
225- binding.shouldContainAndMatchFile(" ActionWithAllTypesOfInputs_Untyped.kt" )
225+ assertSoftly {
226+ binding.shouldContainAndMatchFile(" ActionWithAllTypesOfInputs.kt" )
227+ binding.shouldContainAndMatchFile(" ActionWithAllTypesOfInputs_Untyped.kt" )
228+ }
226229 }
227230
228231 test(" action with outputs" ) {
@@ -471,8 +474,10 @@ class GenerationTest :
471474 )
472475
473476 // then
474- binding.shouldContainAndMatchFile(" ActionWithPartlyTypings.kt" )
475- binding.shouldContainAndMatchFile(" ActionWithPartlyTypings_Untyped.kt" )
477+ assertSoftly {
478+ binding.shouldContainAndMatchFile(" ActionWithPartlyTypings.kt" )
479+ binding.shouldContainAndMatchFile(" ActionWithPartlyTypings_Untyped.kt" )
480+ }
476481 }
477482 })
478483
You can’t perform that action at this time.
0 commit comments