use of org.junit.jupiter.api.condition.DisabledOnOs in project assertj-core by joel-costigliola.
the class Paths_assertHasSameTextualContentAs_Test method should_fail_if_expected_is_not_readable.
@Test
@DisabledOnOs(value = WINDOWS, disabledReason = "gh-2312")
void should_fail_if_expected_is_not_readable() throws IOException {
// GIVEN
Path actual = createFile(tempDir.resolve("actual"));
Path expected = createFile(tempDir.resolve("expected"));
expected.toFile().setReadable(false);
// WHEN
Throwable thrown = catchThrowable(() -> paths.assertHasSameTextualContentAs(info, actual, CHARSET, expected, CHARSET));
// THEN
then(thrown).isInstanceOf(IllegalArgumentException.class).hasMessage("The given Path <%s> to compare actual content to should be readable", expected);
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project assertj-core by joel-costigliola.
the class Paths_assertHasTextualContent_Test method should_fail_if_actual_is_not_readable.
@Test
@DisabledOnOs(value = WINDOWS, disabledReason = "gh-2312")
void should_fail_if_actual_is_not_readable() throws IOException {
// GIVEN
Path actual = createFile(tempDir.resolve("actual"));
actual.toFile().setReadable(false);
String expected = "expected";
// WHEN
AssertionError error = expectAssertionError(() -> paths.assertHasTextualContent(info, actual, expected, CHARSET));
// THEN
then(error).hasMessage(shouldBeReadable(actual).create());
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project assertj-core by joel-costigliola.
the class Paths_assertIsExecutable_Test method should_fail_if_actual_is_not_executable.
@Test
@DisabledOnOs(value = WINDOWS, disabledReason = "gh-2312")
void should_fail_if_actual_is_not_executable() throws IOException {
// GIVEN
Path actual = createFile(tempDir.resolve("actual"));
// WHEN
AssertionError error = expectAssertionError(() -> paths.assertIsExecutable(info, actual));
// THEN
then(error).hasMessage(shouldBeExecutable(actual).create());
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project assertj-core by joel-costigliola.
the class Files_assertHasDigest_AlgorithmString_Test method should_fail_if_actual_exists_but_is_not_readable.
@DisabledOnOs(OS.WINDOWS)
@Test
void should_fail_if_actual_exists_but_is_not_readable() {
// GIVEN
File actual = newFile(tempDir.getAbsolutePath() + "/Test.java");
actual.setReadable(false);
// WHEN
expectAssertionError(() -> files.assertHasDigest(INFO, actual, algorithm, expected));
// THEN
verify(failures).failure(INFO, shouldBeReadable(actual));
}
use of org.junit.jupiter.api.condition.DisabledOnOs in project assertj-core by joel-costigliola.
the class Files_assertHasDigest_DigestString_Test method should_fail_if_actual_exists_but_is_not_readable.
@DisabledOnOs(OS.WINDOWS)
@Test
void should_fail_if_actual_exists_but_is_not_readable() {
// GIVEN
File actual = newFile(tempDir.getAbsolutePath() + "/Test.java");
actual.setReadable(false);
// WHEN
expectAssertionError(() -> files.assertHasDigest(INFO, actual, digest, expected));
// THEN
verify(failures).failure(INFO, shouldBeReadable(actual));
}
Aggregations