function it_outputs_failure_progress_on_afterexample_event(SpecificationEvent $specEvent, ExampleEvent $exampleEvent, ExampleNode $example, SpecificationNode $spec, ConsoleIO $io, StatisticsCollector $stats)
{
$specEvent->getSpecification()->willReturn($spec);
$exampleEvent->getExample()->willReturn($example);
$example->getTitle()->willReturn('foobar');
$exampleEvent->getResult()->willReturn(ExampleEvent::FAILED);
$exampleEvent->getException()->willReturn(new \Exception('Something failed.'));
$spec->getTitle()->willReturn('spec1');
$this->beforeSpecification($specEvent);
$this->afterExample($exampleEvent);
$expected = "not ok 1 - spec1: foobar\n ---\n message: 'Something failed.'\n severity: fail\n ...";
$io->writeln($expected)->shouldHaveBeenCalled();
}