Skip to content

Commit a622ab2

Browse files
authored
Merge pull request objectionary#3996 from a1kuat/master
refactor(WalkTest): Improve test clarity and adhere to conventions
2 parents f0ee6d5 + 91e432c commit a622ab2

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

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

+12-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import com.yegor256.Mktmp;
88
import com.yegor256.MktmpResolver;
99
import java.nio.file.Path;
10-
import java.nio.file.Paths;
1110
import org.cactoos.list.ListOf;
1211
import org.hamcrest.MatcherAssert;
1312
import org.hamcrest.Matchers;
@@ -23,14 +22,19 @@
2322
final class WalkTest {
2423

2524
@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"));
25+
void findsFilesMatchingGlobPattern(@Mktmp final Path temp) throws Exception {
26+
new Saved("", temp.resolve("foo/hello/0.1/EObar/x.bin")).value();
27+
new Saved("", temp.resolve("EOxxx/bar")).value();
28+
final String pattern = "EO**/*";
29+
final int count = 1;
2930
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)
31+
String.format(
32+
"Expected %d file(s) matching pattern '%s'",
33+
count,
34+
pattern
35+
),
36+
new Walk(temp).includes(new ListOf<>(pattern)),
37+
Matchers.iterableWithSize(count)
3338
);
3439
}
35-
3640
}

0 commit comments

Comments
 (0)