diff --git a/action-binding-generator/src/test/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator/Utils.kt b/action-binding-generator/src/test/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator/Utils.kt index 63f2046cd2..acd65820de 100644 --- a/action-binding-generator/src/test/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator/Utils.kt +++ b/action-binding-generator/src/test/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator/Utils.kt @@ -1,7 +1,7 @@ package io.github.typesafegithub.workflows.actionbindinggenerator import io.github.typesafegithub.workflows.actionbindinggenerator.generation.ActionBinding -import io.kotest.assertions.fail +import io.kotest.matchers.Matcher.Companion.failure import io.kotest.matchers.shouldBe import java.nio.file.Paths @@ -27,10 +27,11 @@ fun List.shouldContainAndMatchFile(path: String) { actualContent shouldBe expectedContent } else if (actualContent != expectedContent) { file.writeText(actualContent) - fail( - "The binding's Kotlin code in ${file.name} doesn't match the expected one.\n" + - "The file has been updated to match what's expected.", - ) + actualContent shouldBe + failure( + "The binding's Kotlin code in ${file.name} doesn't match the expected one.\n" + + "The file has been updated to match what's expected.", + ) } } diff --git a/action-binding-generator/src/test/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator/generation/GenerationTest.kt b/action-binding-generator/src/test/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator/generation/GenerationTest.kt index f7769c10d0..4e08800962 100644 --- a/action-binding-generator/src/test/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator/generation/GenerationTest.kt +++ b/action-binding-generator/src/test/kotlin/io/github/typesafegithub/workflows/actionbindinggenerator/generation/GenerationTest.kt @@ -16,6 +16,7 @@ import io.github.typesafegithub.workflows.actionbindinggenerator.typing.IntegerW import io.github.typesafegithub.workflows.actionbindinggenerator.typing.ListOfTypings import io.github.typesafegithub.workflows.actionbindinggenerator.typing.StringTyping import io.github.typesafegithub.workflows.actionbindinggenerator.typing.Typing +import io.kotest.assertions.assertSoftly import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.collections.shouldHaveSize @@ -221,8 +222,10 @@ class GenerationTest : ) // then - binding.shouldContainAndMatchFile("ActionWithAllTypesOfInputs.kt") - binding.shouldContainAndMatchFile("ActionWithAllTypesOfInputs_Untyped.kt") + assertSoftly { + binding.shouldContainAndMatchFile("ActionWithAllTypesOfInputs.kt") + binding.shouldContainAndMatchFile("ActionWithAllTypesOfInputs_Untyped.kt") + } } test("action with outputs") { @@ -471,8 +474,10 @@ class GenerationTest : ) // then - binding.shouldContainAndMatchFile("ActionWithPartlyTypings.kt") - binding.shouldContainAndMatchFile("ActionWithPartlyTypings_Untyped.kt") + assertSoftly { + binding.shouldContainAndMatchFile("ActionWithPartlyTypings.kt") + binding.shouldContainAndMatchFile("ActionWithPartlyTypings_Untyped.kt") + } } })