File tree Expand file tree Collapse file tree
jdoc-cucumber-gradle-plugin/src/test/java/org/bool/jdoc/cucumber/gradle Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ void testGenerate() throws IOException {
4242
4343 action .generate (file .toFile (), "File" , outputPath );
4444
45- assertThat (Files . list (outputPath ). toList ( ))
45+ assertThat (files (outputPath ))
4646 .hasSize (2 );
4747 assertThat (outputPath .resolve ("File_1.feature" ))
4848 .content ().isEqualTo ("test" );
@@ -59,12 +59,12 @@ void testDelete() throws IOException {
5959 Files .writeString (outputPath .resolve ("TestFile.feature" ), "unknown feature" );
6060 Files .writeString (outputPath .resolve ("TestFile_2.java" ), "javafile" );
6161
62- assertThat (Files . list (outputPath ). toList ( ))
62+ assertThat (files (outputPath ))
6363 .hasSize (5 );
6464
6565 action .delete (new File ("any-file.java" ), "TestFile" , outputPath );
6666
67- assertThat (Files . list (outputPath ). toList ( ))
67+ assertThat (files (outputPath ))
6868 .hasSize (2 )
6969 .doesNotContain (
7070 outputPath .resolve ("TestFile_1.feature" ),
@@ -86,4 +86,10 @@ void testDeleteDir() throws IOException {
8686 assertThat (outputPath )
8787 .isEmptyDirectory ();
8888 }
89+
90+ private List <Path > files (Path dir ) throws IOException {
91+ try (var files = Files .list (dir )) {
92+ return files .toList ();
93+ }
94+ }
8995}
You can’t perform that action at this time.
0 commit comments