File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
src/test/java/org/junit/rules Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,17 @@ public void newFolderWithGivenFolderThrowsIOExceptionIfFileExists() throws IOExc
9393 thrown .expectMessage ("could not create a folder with the path 'level1'" );
9494 tempFolder .newFolder ("level1" );
9595 }
96+
97+ @ Test
98+ public void newFolderWithGivenFolderThrowsIOExceptionWhenFolderCannotBeCreated () throws IOException {
99+ tempFolder .create ();
100+ assertTrue ("Could not make folder " + tempFolder .getRoot () + " read only." ,
101+ tempFolder .getRoot ().setReadOnly ());
102+
103+ thrown .expect (IOException .class );
104+ thrown .expectMessage ("could not create a folder with the path 'level1'" );
105+ tempFolder .newFolder ("level1" );
106+ }
96107
97108 @ Test
98109 public void newFolderWithPathStartingWithFileSeparatorThrowsIOException ()
You can’t perform that action at this time.
0 commit comments