Пример #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));
  }