Skip to content

Commit 982aee2

Browse files
committed
refactor(WalkTest): Improve test clarity and adhere to conventions
1 parent f0ee6d5 commit 982aee2

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

eo-maven-plugin/src/test/java/org/eolang/maven/WalkTest.java

+17-8
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,23 @@
2323
final class WalkTest {
2424

2525
@Test
26-
void findsFiles(@Mktmp final Path temp) throws Exception {
27-
new HmBase(temp).save("", Paths.get("foo/hello/0.1/EObar/x.bin"));
28-
new HmBase(temp).save("", Paths.get("EOxxx/bar"));
26+
void findsFilesMatchingGlobPattern(@Mktmp final Path temp) throws Exception {
27+
final String nonMatchingFile = "foo/hello/0.1/EObar/x.bin";
28+
final String matchingFile = "EOxxx/bar";
29+
final String includePattern = "EO**/*";
30+
final int expectedCount = 1;
31+
32+
new HmBase(temp).save("", Paths.get(nonMatchingFile));
33+
new HmBase(temp).save("", Paths.get(matchingFile));
34+
2935
MatcherAssert.assertThat(
30-
"Walk is not iterable with more than 1 item, but it must be",
31-
new Walk(temp).includes(new ListOf<>("EO**/*")),
32-
Matchers.iterableWithSize(1)
36+
String.format(
37+
"Expected %d file(s) matching pattern '%s'",
38+
expectedCount,
39+
includePattern
40+
),
41+
new Walk(temp).includes(new ListOf<>(includePattern)),
42+
Matchers.iterableWithSize(expectedCount)
3343
);
3444
}
35-
36-
}
45+
}

0 commit comments

Comments
 (0)