Skip to content

Commit 9393e69

Browse files
committed
update test util message when no tasks are found
1 parent c7dfe2d commit 9393e69

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

modules/bcv-gradle-plugin/src/testFixtures/kotlin/kotestGradleAssertions.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,17 @@ infix fun BuildResult?.shouldNotHaveRunTask(taskPath: String) {
5555
}
5656

5757
private fun haveTask(taskPath: String): Matcher<BuildResult?> =
58-
neverNullMatcher { value ->
58+
neverNullMatcher { result ->
5959
MatcherResult(
60-
value.task(taskPath) != null,
61-
{ "BuildResult should have run task $taskPath. All tasks: ${value.tasks.toPathAndOutcomeString()}" },
62-
{ "BuildResult should not have run task $taskPath. All tasks: ${value.tasks.toPathAndOutcomeString()}" },
60+
result.task(taskPath) != null,
61+
{ "BuildResult should have run task $taskPath. All tasks: ${result.tasks.toPathAndOutcomeString()}" },
62+
{ "BuildResult should not have run task $taskPath. All tasks: ${result.tasks.toPathAndOutcomeString()}" },
6363
)
6464
}
6565

6666
internal fun Collection<BuildTask>.toPathAndOutcomeString(): String =
6767
joinToString { "${it.path} (${it.outcome})" }
68+
.ifEmpty { "<no tasks found>" }
6869

6970
infix fun BuildTask?.shouldHaveOutcome(outcome: TaskOutcome) {
7071
this should haveOutcome(outcome)

0 commit comments

Comments
 (0)