spec\PhpSpec\CodeGenerator\Generator\NewFileNotifyingGeneratorSpec::it_should_dispatch_an_event_with_the_spec_path_when_a_spec_is_created PHP Method

it_should_dispatch_an_event_with_the_spec_path_when_a_spec_is_created() public method

public it_should_dispatch_an_event_with_the_spec_path_when_a_spec_is_created ( $generator, $dispatcher, $filesystem, PhpSpec\Locator\Resource $resource )
$resource PhpSpec\Locator\Resource
    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();
    }