FitFixtureReportingSystem implements ReportingSystem { protected void addCell(final Parse cell) { if (newRowTail == null) { newRowAttached().parts = cell; } else { newRowTail.more = cell; } newRowTail = cell; } FitFixtureReportingSystem(final Fixture fixture, final Parse table); @Override void endRow(final MatchResult res, final String description); @Override void endRow(final MatchResult res); @Override void addCell(final MatchResult res); @Override void addException(final Throwable ex); @Override void incRight(); Parse getTable();  }
@Test public void shouldCallFixtureRightOnCellRight() { reportingSystem.addCell(createCellResult("*cell-demo-1*", SUCCESS)); verify(fixture).right(captor.capture()); assertThat(captor.getValue().body, hasToString("*cell-demo-1*")); }
@Test public void shouldAddCellWithClassPassToOutput() { reportingSystem = new FitFixtureReportingSystem(new Fixture(), table); reportingSystem.addCell(createCellResult("*cell-demo-1*", SUCCESS)); assertThat(table, numCellsWith(1, "*cell-demo-1*", "pass")); }
@Test public void shouldAddCellWithClassFailToOutput() { reportingSystem = new FitFixtureReportingSystem(new Fixture(), table); reportingSystem.addCell(createCellResult("*GOOD-1*", "*BAD-2*", WRONG)); assertThat(table, numCellsWith(1, "*GOOD-1*", "fail")); }