function it_should_dispatch_an_event_with_the_spec_path_when_a_spec_is_created($generator, $dispatcher, $filesystem, Resource $resource)
{
$path = '/foo';
$generator->supports($resource, 'specification', array())->willReturn(true);
$generator->generate(Argument::cetera())->shouldBeCalled();
$resource->getSpecFilename()->willReturn($path);
$filesystem->pathExists($path)->willReturn(false, true);
$event = new FileCreationEvent($path);
$this->generate($resource, array());
$dispatcher->dispatch('afterFileCreation', $event)->shouldHaveBeenCalled();
}