DiagnosticsAsserter asserter = new DiagnosticsAsserter(chain);
asserter.assertAll(asserter.issue(IPPDiagnostics.ISSUE__STRING_BOOLEAN).optional().greedy());
RakefileInfo rakefileInfo = result.getRakefileInfo();
assertEquals("Should have found two rakefiles", 2, rakefileInfo.getRakefiles().size());
Rakefile rakefile = rakefileInfo.getRakefiles().get(0);
List<String> rakefilePaths = Lists.newArrayList();
rakefilePaths.add(rakefile.getPath().toString());
assertEquals("Should have found 4 tasks", 4, rakefile.getTasks().size());
assertTask(rakefile.getTasks().get(0), "outer:myspace:mytask", "this is my task");
assertTask(rakefile.getTasks().get(1), "outer:cucumberTask", "a cucumber task");
assertTask(rakefile.getTasks().get(2), "outer:rspecTask", "a rspec task");
assertTask(rakefile.getTasks().get(3), "default", "the default task");
rakefile = rakefileInfo.getRakefiles().get(1);
rakefilePaths.add(rakefile.getPath().toString());
assertTrue("Should contain a/Rakefile", rakefilePaths.contains("a/Rakefile"));
assertTrue("Should contain b/Rakefile", rakefilePaths.contains("b/alternative.rake"));
assertEquals("Should have found 4 tasks", 4, rakefile.getTasks().size());
assertTask(rakefile.getTasks().get(0), "outer:myspace:mytask", "this is my task");
assertTask(rakefile.getTasks().get(1), "outer:cucumberTask", "a cucumber task");
assertTask(rakefile.getTasks().get(2), "outer:rspecTask", "a rspec task");
assertTask(rakefile.getTasks().get(3), "default", "the default task");
}