-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Prefer the more speaking
shouldHaveSize
over asserting the size
Signed-off-by: Sebastian Schuberth <[email protected]>
- Loading branch information
1 parent
0c92be6
commit 2b4f3ab
Showing
10 changed files
with
31 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ import io.kotest.core.spec.style.WordSpec | |
import io.kotest.inspectors.forAll | ||
import io.kotest.matchers.collections.containExactlyInAnyOrder | ||
import io.kotest.matchers.collections.shouldContain | ||
import io.kotest.matchers.collections.shouldHaveSize | ||
import io.kotest.matchers.collections.shouldNotContain | ||
import io.kotest.matchers.nulls.beNull | ||
import io.kotest.matchers.should | ||
|
@@ -150,7 +151,7 @@ class OpossumReporterTest : WordSpec({ | |
val signals = opossumInput.getSignalsForFile( | ||
"/pom.xml/compile/first-package-group/[email protected]/LICENSE" | ||
) | ||
signals.size shouldBe 2 | ||
signals shouldHaveSize 2 | ||
signals.find { it.source == "[email protected]" } shouldNotBeNull { | ||
license.toString() shouldBe "Apache-2.0" | ||
} | ||
|
@@ -161,7 +162,7 @@ class OpossumReporterTest : WordSpec({ | |
"/pom.xml/compile/first-package-group/[email protected]/project-path/some/file" | ||
) | ||
|
||
signals.size shouldBe 2 | ||
signals shouldHaveSize 2 | ||
signals.find { it.source == "[email protected]" } shouldNotBeNull { | ||
copyright shouldContain "Copyright 2020 Some copyright holder in source artifact" | ||
copyright shouldContain "Copyright 2020 Some other copyright holder in source artifact" | ||
|
@@ -212,14 +213,14 @@ class OpossumReporterTest : WordSpec({ | |
val issuesFromFirstPackage = | ||
opossumInput.getSignalsForFile("/pom.xml/compile/first-package-group/[email protected]") | ||
.filter { it.comment?.contains(Regex("Source-.*Message-")) == true } | ||
issuesFromFirstPackage.size shouldBe 4 | ||
issuesFromFirstPackage shouldHaveSize 4 | ||
issuesFromFirstPackage.forAll { | ||
it.followUp shouldBe true | ||
it.excludeFromNotice shouldBe true | ||
} | ||
|
||
val issuesAttachedToFallbackPath = opossumInput.getSignalsForFile("/") | ||
issuesAttachedToFallbackPath.size shouldBe 1 | ||
issuesAttachedToFallbackPath shouldHaveSize 1 | ||
issuesAttachedToFallbackPath.forAll { | ||
it.followUp shouldBe true | ||
it.excludeFromNotice shouldBe true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters