function it_decorates_expectation_with_failed_event(Expectation $expectation, EventDispatcherInterface $dispatcher)
{
$alias = 'be';
$subject = new \stdClass();
$arguments = array();
$expectation->match(Argument::cetera())->willThrow('PhpSpec\\Exception\\Example\\FailureException');
$dispatcher->dispatch('beforeExpectation', Argument::type('PhpSpec\\Event\\ExpectationEvent'))->shouldBeCalled();
$dispatcher->dispatch('afterExpectation', Argument::which('getResult', ExpectationEvent::FAILED))->shouldBeCalled();
$this->shouldThrow('PhpSpec\\Exception\\Example\\FailureException')->duringMatch($alias, $subject, $arguments);
}