### Question:
TextUI { public boolean hasFailures() { return hasFailures || hasInternalErrors; } TextUI(MessageReceiver<Event<SuiteListener>> eventStream, Printer printer); void setPassingTestsVisible(boolean passingTestsVisible); void setProgressBarVisible(boolean progressBarVisible); boolean hasFailures(); void update(); void updateUntilFinished();  }### Answer:
@Test public void tells_when_the_suite_had_no_failures() { SuiteMother.onePassingTest(listener); runAndGetOutput(); assertThat("has failures", ui.hasFailures(), is(false)); }
@Test public void tells_when_the_suite_had_some_failures() { SuiteMother.oneFailingTest(listener); runAndGetOutput(); assertThat("has failures", ui.hasFailures(), is(true)); }
@Test public void empty_suite_is_considered_to_be_passing() { SuiteMother.emptySuite(listener); runAndGetOutput(); assertThat("has failures", ui.hasFailures(), is(false)); }
@Test public void internal_errors_fail_the_whole_suite() { SuiteMother.internalError(listener); runAndGetOutput(); assertThat("has failures", ui.hasFailures(), is(true)); }