@Test public void canFindTaskByAbsolutePath() { Task task = task("task"); expectTaskLookupInOtherProject(":", "task", task); assertThat(container.findByPath(":task"), sameInstance(task)); }
@Test public void findByPathReturnsNullForUnknownProject() { context.checking( new Expectations() { { allowing(project).findProject(":unknown"); will(returnValue(null)); } }); assertThat(container.findByPath(":unknown:task"), nullValue()); }
@Test public void findByPathReturnsNullForUnknownTask() { expectTaskLookupInOtherProject(":other", "task", null); assertThat(container.findByPath(":other:task"), nullValue()); }
@Test public void canFindTaskByName() { Task task = addTask("task"); assertThat(container.findByPath("task"), sameInstance(task)); }