function it_throws_an_exception_on_no_class_definition(Filesystem $fs, SplFileInfo $file)
{
$this->beConstructedWith($fs, 'PhpSpec', 'spec', $this->srcPath, $this->specPath);
$filePath = $this->specPath . $this->convert_to_path('/spec/PhpSpec/Some/ClassSpec.php');
$fs->pathExists($this->specPath . $this->convert_to_path('/spec/PhpSpec/'))->willReturn(true);
$fs->findSpecFilesIn($this->specPath . $this->convert_to_path('/spec/PhpSpec/'))->willReturn(array($file));
$fs->getFileContents($filePath)->willReturn('no class definition');
$file->getRealPath()->willReturn($filePath);
$exception = new \RuntimeException(sprintf('Spec file "%s" does not contains any class definition.', $filePath));
$this->shouldThrow($exception)->duringFindResources($this->srcPath);
}