Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
Make FileFInder tests slightly more readable.
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrisztian committed Aug 26, 2023
1 parent ec93a56 commit 84698b4
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class FileFinderTest extends Specification {
@TempDir
private Path tempDir

private final List<Path> foundFiles = []
private final List<String> foundFiles = []

void setup() {
def exampleClass = Paths.get this.class.classLoader.getResource('example.class').toURI()
Expand Down Expand Up @@ -76,8 +76,8 @@ class FileFinderTest extends Specification {
then:
verifyAll(foundFiles) {
it?.size() == 2
it?.any { it as String =~ $/\ba/d/example.groovy/$ }
it?.any { it as String =~ $/\ba/e/greek.txt/$ }
it?.any { it =~ $/\ba/d/example.groovy/$ }
it?.any { it =~ $/\ba/e/greek.txt/$ }
}
}

Expand Down Expand Up @@ -110,14 +110,14 @@ class FileFinderTest extends Specification {
then:
verifyAll(foundFiles) {
it?.size() == 2
it[0] as String =~ $/a/d/anotherExample.groovy/$
it[1] as String =~ $/a/d/example.groovy/$
it[0] =~ $/a/d/anotherExample.groovy/$
it[1] =~ $/a/d/example.groovy/$
}
}

private void findFiles(Conf conf) {
new FileFinder(conf, LogMock.get(), tempDir).find {
foundFiles << it
foundFiles << (it as String)
}
}

Expand Down

0 comments on commit 84698b4

Please sign in to comment.