Skip to content

Commit 4688174

Browse files
committed
cannot change read access permissions on some operating systems, so we have to skip this testcase there
1 parent cb26ae5 commit 4688174

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎hamcrest-unit-test/src/main/java/org/hamcrest/io/FileMatchersTest.java‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@ public void testAnExistingFile() {
4646

4747
@Test
4848
public void testAReadableFile() {
49+
file.setReadable(true);
4950
assertMatches("matches readable file", FileMatchers.aReadableFile(), file);
50-
file.setReadable(false);
51-
assertDoesNotMatch("doesn't match unreadable file", FileMatchers.aReadableFile(), file);
51+
if (file.setReadable(false)) {
52+
assertDoesNotMatch("doesn't match unreadable file", FileMatchers.aReadableFile(), file);
53+
}
5254
}
5355

5456
@Test

0 commit comments

Comments
 (0)