Exemplo n.º 1
0
  @Test
  public void canFindTaskByAbsolutePath() {
    Task task = task("task");
    expectTaskLookupInOtherProject(":", "task", task);

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

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

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

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