spec\PhpSpec\CodeGenerator\Generator\SpecificationGeneratorSpec::it_creates_folder_for_spec_if_needed PHP Method

it_creates_folder_for_spec_if_needed() public method

public it_creates_folder_for_spec_if_needed ( $io, $tpl, $fs, PhpSpec\Locator\Resource $resource )
$resource PhpSpec\Locator\Resource
    function it_creates_folder_for_spec_if_needed($io, $tpl, $fs, Resource $resource)
    {
        $resource->getSpecName()->willReturn('AppAppSpec');
        $resource->getSpecFilename()->willReturn('/project/spec/Acme/AppSpec.php');
        $resource->getSpecNamespace()->willReturn('spec\\Acme');
        $resource->getSrcClassname()->willReturn('Acme\\App');
        $resource->getName()->willReturn('App');
        $fs->pathExists('/project/spec/Acme/AppSpec.php')->willReturn(false);
        $fs->isDirectory('/project/spec/Acme')->willReturn(false);
        $fs->makeDirectory('/project/spec/Acme')->shouldBeCalled();
        $fs->putFileContents('/project/spec/Acme/AppSpec.php', Argument::any())->willReturn(null);
        $this->generate($resource);
    }