function it_should_dispatch_an_event_when_a_file_is_created($dispatcher, $filesystem, Resource $resource)
{
$path = '/foo';
$resource->getSrcFilename()->willReturn($path);
$event = new FileCreationEvent($path);
$filesystem->pathExists($path)->willReturn(false, true);
$this->generate($resource, array());
$dispatcher->dispatch('afterFileCreation', $event)->shouldHaveBeenCalled();
}