Merge pull request #9 from kemitix/cross-platform-build
Cross platform build
This commit is contained in:
commit
aa443a26a6
2 changed files with 7 additions and 3 deletions
|
@ -50,7 +50,7 @@ import java.util.stream.Stream;
|
|||
@RequiredArgsConstructor
|
||||
class CheckstyleWriter implements CommandLineRunner {
|
||||
|
||||
private static final String NEWLINE = "\n";
|
||||
private static final String NEWLINE = System.getProperty("line.separator");
|
||||
|
||||
private final OutputProperties outputProperties;
|
||||
|
||||
|
|
|
@ -30,6 +30,8 @@ public class CheckstyleWriterTest {
|
|||
|
||||
private static final String TEMPLATE = "C:%s\nTW:%s";
|
||||
|
||||
private static final String FILE_SEPARATOR = System.getProperty("file.separator");
|
||||
|
||||
private CheckstyleWriter checkstyleWriter;
|
||||
|
||||
private OutputProperties outputProperties;
|
||||
|
@ -181,9 +183,11 @@ public class CheckstyleWriterTest {
|
|||
@Test
|
||||
public void throwRteIfErrorWritingFile() throws Exception {
|
||||
//given
|
||||
outputProperties.setDirectory(Paths.get("/../imaginary"));
|
||||
final String imaginary = String.join(FILE_SEPARATOR, "", "..", "imaginary");
|
||||
outputProperties.setDirectory(Paths.get(imaginary));
|
||||
exception.expect(RuntimeException.class);
|
||||
exception.expectMessage("java.nio.file.NoSuchFileException: /../imaginary/checkstyle-LAYOUT.xml");
|
||||
exception.expectMessage(
|
||||
"java.nio.file.NoSuchFileException: " + imaginary + FILE_SEPARATOR + "checkstyle-LAYOUT.xml");
|
||||
//when
|
||||
checkstyleWriter.run();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue