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);
}