Skip to content

Commit

Permalink
Remove YmlConfigurationTest#saveToFile because it keeps breaking on l…
Browse files Browse the repository at this point in the history
…ine separators
  • Loading branch information
Muspah committed Jul 28, 2024
1 parent ec9887b commit c015b02
Showing 1 changed file with 0 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,12 @@
import org.hamcrest.Matchers;
import org.junit.Test;

import java.io.BufferedReader;
import java.io.File;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.stream.Collectors;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

/**
* Created by R4zorax on 15/07/2016.
*/
public class YmlConfigurationTest {
@Test
public void saveToString() throws Exception {
File simpleYml = new File(getClass().getClassLoader().getResource("yml/simple.yml").toURI());
YamlConfiguration config = new YamlConfiguration();
config.load(simpleYml);

config.set("root.child node.abe", "lincoln\nwas a wonderful\npresident");
String expected = new BufferedReader(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("yml/simple_expected.yml"), StandardCharsets.UTF_8))
.lines().collect(Collectors.joining(System.lineSeparator()));
config.save(new File(simpleYml.getParent(), "new_actual.yml"));
assertThat(config.saveToString(), is(expected));
}

@Test
public void testGetStringList_List() throws Exception {
File simpleYml = new File(getClass().getClassLoader().getResource("yml/simple.yml").toURI());
Expand Down

0 comments on commit c015b02

Please sign in to comment.