wasInvoked

fun Expect<BuildTask?>.wasInvoked(): Expect<BuildTask>

Expects that the subject of the assertion (a Gradle task) was invoked. This means that it was either invoked explicitly in the command line, or that it was a (transitive) dependency of another task that was explicitly invoked in the command line.

Return

An Expect with the non-nullable type BuildTask (was BuildTask? before).

fun Expect<BuildTask?>.wasInvoked(assertionCreator: Expect<BuildTask>.() -> Unit): Expect<BuildTask?>

Expects that the subject of the assertion (a Gradle task) was invoked and adds all assertions created by assertionCreator to the Expect for the for the subject. A task was invoked iff it was either invoked explicitly in the command line, or it was a (transitive) dependency of another task that was explicitly invoked in the command line.

Return

An Expect for the current subject of the assertion.

Throws

If assertionCreator creates no assertions or throws an AssertionError itself.