will(returnValue(toSet(dependsOn)));
}});
}
private Task brokenTask(String name, final RuntimeException failure, final Task... dependsOn) {
final TaskInternal task = context.mock(TaskInternal.class);
final TaskStateInternal state = context.mock(TaskStateInternal.class);
setExpectations(name, task, state);
dependsOn(task, dependsOn);
context.checking(new Expectations() {{
atMost(1).of(task).executeWithoutThrowingTaskFailure();