}
}
@Test
public void selectProjectFailsWhenMultipleProjectsHaveSpecifiedProjectDir() {
ProjectIdentifier project1 = project(dir);
ProjectIdentifier project2 = project(dir);
try {
spec.selectProject(registry(project1, project2));
fail();
} catch (InvalidUserDataException e) {
assertThat(e.getMessage(), startsWith("Multiple projects in this build have project directory '" + dir + "':"));