@@ -261,46 +261,6 @@ void canCheckStateClass() {
261
261
assertThat (Require .state ("That" , arg2 ).instanceOf (String .class )).isSameAs (arg2 );
262
262
}
263
263
264
- @ Test
265
- void canCheckFileState () throws IOException {
266
- assertThatExceptionOfType (IllegalStateException .class )
267
- .isThrownBy (() -> Require .state ("Target" , (Path ) null ).isFile ())
268
- .withMessage ("Target must be set" );
269
- File tempFile = File .createTempFile ("example" , "tmp" );
270
- tempFile .deleteOnExit ();
271
- assertThat (Require .state ("Target" , tempFile .toPath ()).isFile ()).isSameAs (tempFile .toPath ());
272
- File dir = tempFile .getParentFile ();
273
- assertThatExceptionOfType (IllegalStateException .class )
274
- .isThrownBy (() -> Require .state ("Target" , dir .toPath ()).isFile ())
275
- .withMessage ("Target must be a regular file: %s" , dir );
276
- if (!tempFile .delete ()) {
277
- fail ("Unable to delete temp file" );
278
- }
279
- assertThatExceptionOfType (IllegalStateException .class )
280
- .isThrownBy (() -> Require .state ("Target" , tempFile .toPath ()).isFile ())
281
- .withMessage ("Target must exist: %s" , tempFile );
282
- }
283
-
284
- @ Test
285
- void canCheckDirectoryState () throws IOException {
286
- assertThatExceptionOfType (IllegalStateException .class )
287
- .isThrownBy (() -> Require .state ("Target" , (Path ) null ).isDirectory ())
288
- .withMessage ("Target must be set" );
289
- File tempFile = File .createTempFile ("example" , "tmp" );
290
- tempFile .deleteOnExit ();
291
- assertThatExceptionOfType (IllegalStateException .class )
292
- .isThrownBy (() -> Require .state ("Target" , tempFile .toPath ()).isDirectory ())
293
- .withMessage ("Target must be a directory: %s" , tempFile );
294
- File dir = tempFile .getParentFile ();
295
- assertThat (Require .state ("Target" , dir .toPath ()).isDirectory ()).isSameAs (dir .toPath ());
296
- if (!tempFile .delete ()) {
297
- fail ("Unable to delete temp file" );
298
- }
299
- assertThatExceptionOfType (IllegalStateException .class )
300
- .isThrownBy (() -> Require .state ("Target" , tempFile .toPath ()).isDirectory ())
301
- .withMessage ("Target must exist: %s" , tempFile );
302
- }
303
-
304
264
@ Test
305
265
void canCheckFilePathState () throws IOException {
306
266
assertThatExceptionOfType (IllegalStateException .class )
0 commit comments