Add duplicate-key checking to concourse editor

This commit is contained in:
Kris De Volder
2016-12-21 08:46:47 -08:00
parent 302938ab75
commit 216e96156a
2 changed files with 51 additions and 1 deletions

View File

@@ -439,7 +439,30 @@ public class PipelineYamlEditorTest {
, // =>
"repo-a<*>", "repo-b<*>"
);
}
@Test
public void reconcileDuplicateKeys() throws Exception {
Editor editor = harness.newEditor(
"resources:\n" +
"- name: my-repo\n" +
" type: git\n" +
" source:\n" +
" repository: https://github.com/kdvolder/my-repo\n" +
"resources:\n" +
"- name: your-repo\n" +
" type: git\n" +
" type: git\n" +
" source:\n" +
" repository: https://github.com/kdvolder/forked-repo\n"
);
editor.assertProblems(
"resources|Duplicate key",
"resources|Duplicate key",
"type|Duplicate key",
"type|Duplicate key"
);
}
//////////////////////////////////////////////////////////////////////////////