Skip to content

Commit

Permalink
Merge pull request #618 from phansys/is_git_dir_2
Browse files Browse the repository at this point in the history
Update tests
  • Loading branch information
cordoval authored Aug 10, 2016
2 parents 235a4d7 + e92d352 commit d85ea07
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Helper/ProcessHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function runCommand($command, $allowFailures = false, $callback = null)
$process->run($callback);

if (!$process->isSuccessful() && !$allowFailures) {
throw new \RuntimeException($process->getErrorOutput());
throw new \RuntimeException(trim($process->getErrorOutput()), (int) $process->getExitCode());
}

return trim($process->getOutput());
Expand Down
5 changes: 2 additions & 3 deletions tests/Helper/GitHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,14 @@ public function returns_false_when_top_git_dir_was_expected()
}

/**
* @test
* @runInSeparateProcess
*/
public function returns_false_for_non_git_dir()
public function testThrowExceptionForNonGitDir()
{
chdir(sys_get_temp_dir());

$this->setExpectedExceptionRegExp('\RuntimeException', '#^fatal: Not a git repository \(or any of the parent directories\): \.git$#', 128);
$this->assertFalse($this->git->isGitDir());
$this->assertFalse($this->git->isGitDir(false));
}

/**
Expand Down

0 comments on commit d85ea07

Please sign in to comment.