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

it_generates_spec_class_from_resource_and_puts_it_into_appropriate_folder() public method

public it_generates_spec_class_from_resource_and_puts_it_into_appropriate_folder ( $io, $tpl, $fs, PhpSpec\Locator\Resource $resource )
$resource PhpSpec\Locator\Resource
    function it_generates_spec_class_from_resource_and_puts_it_into_appropriate_folder($io, $tpl, $fs, Resource $resource)
    {
        $resource->getSpecName()->willReturn('AppSpec');
        $resource->getSpecFilename()->willReturn('/project/spec/Acme/AppSpec.php');
        $resource->getSpecNamespace()->willReturn('spec\\Acme');
        $resource->getSrcClassname()->willReturn('Acme\\App');
        $resource->getName()->willReturn('App');
        $values = array('%filepath%' => '/project/spec/Acme/AppSpec.php', '%name%' => 'AppSpec', '%namespace%' => 'spec\\Acme', '%subject%' => 'Acme\\App', '%subject_class%' => 'App');
        $tpl->render('specification', $values)->willReturn(null);
        $tpl->renderString(Argument::type('string'), $values)->willReturn('generated code');
        $fs->pathExists('/project/spec/Acme/AppSpec.php')->willReturn(false);
        $fs->isDirectory('/project/spec/Acme')->willReturn(true);
        $fs->putFileContents('/project/spec/Acme/AppSpec.php', 'generated code')->shouldBeCalled();
        $this->generate($resource);
    }