示例#1
0
  @Test
  @SuppressWarnings("unchecked")
  public void parse_object() throws IOException {
    List<Object> members =
        (List<Object>) parser.parse(resources.sourceFile(Paths.get("_data", "members.yml")));

    assertThat(members).hasSize(3);
    assertThat((Map<String, Object>) members.get(0))
        .containsExactly(entry("name", "Tom Preston-Werner"), entry("github", "mojombo"));
  }
示例#2
0
  @Test
  public void parse_map() {
    Map<String, Object> map = parser.parseMap(new SourceFile(null, "name: Bob"));

    assertThat(map).containsExactly(entry("name", "Bob"));
  }
示例#3
0
  @Test
  public void parse_empty_map() {
    Map<String, Object> map = parser.parseMap(new SourceFile(null, ""));

    assertThat(map).isEmpty();
  }