コード例 #1
0
  @Before
  public void setup() {
    context.setImposteriser(ClassImposteriser.INSTANCE);
    project = context.mock(ProjectInternal.class);
    renderer = context.mock(PropertyReportRenderer.class);

    context.checking(
        new Expectations() {
          {
            allowing(project).absolutePath("list");
            will(returnValue(":path"));
          }
        });

    task = new PropertyReportTask(project, "list");
    task.setRenderer(renderer);
  }
コード例 #2
0
  @Test
  public void doesNotShowContentsOfThePropertiesProperty() throws IOException {
    context.checking(
        new Expectations() {
          {
            one(project).getProperties();
            will(returnValue(GUtil.map("prop", "value", "properties", "prop")));

            Sequence sequence = context.sequence("seq");

            one(renderer).addProperty("prop", "value");
            inSequence(sequence);
            one(renderer).addProperty("properties", "{...}");
            inSequence(sequence);
          }
        });

    task.generate(project);
  }
コード例 #3
0
  @Test
  public void passesEachProjectPropertyToRenderer() throws IOException {
    context.checking(
        new Expectations() {
          {
            one(project).getProperties();
            will(returnValue(GUtil.map("b", "value2", "a", "value1")));

            Sequence sequence = context.sequence("seq");

            one(renderer).addProperty("a", "value1");
            inSequence(sequence);

            one(renderer).addProperty("b", "value2");
            inSequence(sequence);
          }
        });

    task.generate(project);
  }