diff --git a/apis/infix-en_GB/atrium-api-infix-en_GB-common/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/ThrowableAssertionsSpec.kt b/apis/infix-en_GB/atrium-api-infix-en_GB-common/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/ThrowableAssertionsSpec.kt index e368a15f3..dafb037b7 100644 --- a/apis/infix-en_GB/atrium-api-infix-en_GB-common/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/ThrowableAssertionsSpec.kt +++ b/apis/infix-en_GB/atrium-api-infix-en_GB-common/src/test/kotlin/ch/tutteli/atrium/api/infix/en_GB/ThrowableAssertionsSpec.kt @@ -2,25 +2,18 @@ package ch.tutteli.atrium.api.infix.en_GB import ch.tutteli.atrium.creating.Expect import ch.tutteli.atrium.specs.* +import ch.tutteli.atrium.specs.testutils.WithAsciiReporter import ch.tutteli.atrium.specs.withFeatureSuffix class ThrowableAssertionsSpec : ch.tutteli.atrium.specs.integration.ThrowableAssertionsSpec( property(Expect::message), fun1.() -> Unit>(Expect::message), fun2(::messageContains), - ("cause" to Companion::causeFeature).withFeatureSuffix(), - "cause" to Companion::cause + ("cause" to ::causeFeature).withFeatureSuffix(), + "cause" to ::cause ) { - companion object { - - @Suppress("RemoveExplicitTypeArguments") - private fun causeFeature(expect: Expect): Expect = expect.cause() - - @Suppress("RemoveExplicitTypeArguments") - private fun cause(expect: Expect, assertionCreator: Expect.() -> Unit) = - expect.cause(assertionCreator) - } + companion object : WithAsciiReporter() @Suppress("unused", "UNUSED_VALUE") private fun ambiguityTest() { @@ -33,10 +26,18 @@ class ThrowableAssertionsSpec : ch.tutteli.atrium.specs.integration.ThrowableAss a1 = a1 messageContains Values("a", 1, 'b') a1.cause() - a1.cause { message { }} + a1.cause { message { } } } } private fun messageContains(expect: Expect, expected: Any, vararg otherExpected: Any): Expect = if (otherExpected.isEmpty()) expect messageContains expected else expect messageContains Values(expected, *otherExpected) + +@Suppress("RemoveExplicitTypeArguments") +private fun causeFeature(expect: Expect): Expect = + expect.cause() + +@Suppress("RemoveExplicitTypeArguments") +private fun cause(expect: Expect, assertionCreator: Expect.() -> Unit) = + expect.cause(assertionCreator)