예제 #1
0
  @Test
  public void canFindTaskByAbsolutePath() {
    Task task = task("task");
    expectTaskLookupInOtherProject(":", "task", task);

    assertThat(container.findByPath(":task"), sameInstance(task));
  }
예제 #2
0
  @Test
  public void findByPathReturnsNullForUnknownProject() {
    context.checking(
        new Expectations() {
          {
            allowing(project).findProject(":unknown");
            will(returnValue(null));
          }
        });

    assertThat(container.findByPath(":unknown:task"), nullValue());
  }
예제 #3
0
  @Test
  public void findByPathReturnsNullForUnknownTask() {
    expectTaskLookupInOtherProject(":other", "task", null);

    assertThat(container.findByPath(":other:task"), nullValue());
  }
예제 #4
0
  @Test
  public void canFindTaskByName() {
    Task task = addTask("task");

    assertThat(container.findByPath("task"), sameInstance(task));
  }