@Test
void defaultConfigIsWrittenCorrectly() throws IOException {

    File original = tempFolder.resolve("loaded.yml").toFile();
    File written = tempFolder.resolve("written.yml").toFile();
    TestResources.copyResourceIntoFile(original, "/assets/plan/config.yml");
    try (ConfigReader reader = new ConfigReader(Files.newInputStream(original.toPath()))) {
        new ConfigWriter(written.toPath()).write(reader.read());
    }
    List<String> originalLines = FileResource.lines(original);
    List<String> writtenLines = FileResource.lines(written);
    assertFalse(originalLines.isEmpty());
    assertFalse(writtenLines.isEmpty());
    StringBuilder differing = new StringBuilder();
    for (int i = 0; i < originalLines.size(); i++) {
        String origLine = originalLines.get(i);
        String testLine = writtenLines.get(i).replace("    ", "  ");
        if (!origLine.equals(testLine)) {
            differing.append(i + 1).append("! ").append(origLine).append("\n");
            differing.append(i + 1).append("! ").append(testLine).append("\n\n");
        }
    }
    assertEquals(0, differing.length(), differing::toString);
}