diff --git a/spec/GrumPHP/Locator/ChangedFilesSpec.php b/spec/GrumPHP/Locator/ChangedFilesSpec.php index 0f2d5531d..5077825a9 100644 --- a/spec/GrumPHP/Locator/ChangedFilesSpec.php +++ b/spec/GrumPHP/Locator/ChangedFilesSpec.php @@ -4,6 +4,7 @@ use Gitonomy\Git\Diff\Diff; use Gitonomy\Git\Diff\File; +use Gitonomy\Git\WorkingCopy; use Gitonomy\Git\Repository; use PhpSpec\ObjectBehavior; use Prophecy\Argument; @@ -37,13 +38,14 @@ protected function mockFile($name, $isRename = false, $isDelete = false) return $file->reveal(); } - function it_will_list_all_diffed_files(Repository $repository, Diff $diff) + function it_will_list_all_diffed_files(Repository $repository, Diff $diff, WorkingCopy $workingCopy) { $changedFile = $this->mockFile('file1.txt'); $movedFile = $this->mockFile('file2.txt', true); $deletedFile = $this->mockFile('file3.txt', false, true); - $repository->getDiff('HEAD')->willReturn($diff); + $repository->getWorkingCopy()->willReturn($workingCopy); + $workingCopy->getDiffStaged()->willReturn($diff); $diff->getFiles()->willReturn(array($changedFile, $movedFile, $deletedFile)); $result = $this->locate();