testFile("settings.gradle").writelns(
"include 'child'",
"project(':child').projectDir = rootProject.projectDir");
testFile("build.gradle").write("// empty");
ExecutionFailure result = inTestDirectory().withTasks("test").runWithFailure();
result.assertThatDescription(startsWith("Could not select the default project for this build. Multiple projects in this build have project directory"));
result = usingProjectDir(getTestDir()).withTasks("test").runWithFailure();
result.assertThatDescription(startsWith("Could not select the default project for this build. Multiple projects in this build have project directory"));
result = usingBuildFile(testFile("build.gradle")).withTasks("test").runWithFailure();
result.assertThatDescription(startsWith("Could not select the default project for this build. Multiple projects in this build have build file"));
}