main.kotlin.ch.tutteli.atrium.logic.logic.kt Maven / Gradle / Ivy
@file:Suppress("ObjectPropertyName", "FunctionName")
package ch.tutteli.atrium.logic
import ch.tutteli.atrium.assertions.Assertion
import ch.tutteli.atrium.creating.AssertionContainer
import ch.tutteli.atrium.creating.Expect
/**
* Appends the [Assertion] the given [assertionCreator] creates based on this [Expect].
*
* Use [_logic] for more sophisticated scenarios, like feature extraction.
*/
inline fun Expect._logicAppend(assertionCreator: AssertionContainer.() -> Assertion): Expect =
_logic.run { append(assertionCreator()) }
/**
* Entry point to the logic level of Atrium -- which is one level deeper than the API --
* on which assertion functions do not return [Expect]s but [Assertion]s and the like.
*
* Use [_logicAppend] in case you want to create and append an [Assertion] to this [Expect].
*/
inline val Expect._logic: AssertionContainer
get() = this.toAssertionContainer()