[Nostromo] Improve Tests and Coverage

This commit is contained in:
Andrés Montañez
2017-01-05 21:22:38 -03:00
parent 68e65827fa
commit 8c49823e15
9 changed files with 152 additions and 7 deletions
@@ -89,11 +89,15 @@ class ListCommand extends AbstractCommand
/** @var Process $process */
$process = $this->runtime->runRemoteCommand($cmdListReleases, false);
if (!$process->isSuccessful()) {
throw new RuntimeException(sprintf('Unable to retrieve releases from host %s', $host), 80);
throw new RuntimeException(sprintf('Unable to retrieve releases from host "%s"', $host), 80);
}
$releases = explode(PHP_EOL, trim($process->getOutput()));
rsort($releases);
if (trim($process->getOutput()) != '') {
$releases = explode(PHP_EOL, trim($process->getOutput()));
rsort($releases);
} else {
$releases = [];
}
if (count($releases) == 0) {
$output->writeln(sprintf(' No releases available on host <fg=black;options=bold>%s</>:', $host));
@@ -104,7 +108,7 @@ class ListCommand extends AbstractCommand
/** @var Process $process */
$process = $this->runtime->runRemoteCommand($cmdCurrentRelease, false);
if (!$process->isSuccessful()) {
throw new RuntimeException(sprintf('Unable to retrieve current release from host %s', $host), 85);
throw new RuntimeException(sprintf('Unable to retrieve current release from host "%s"', $host), 85);
}
$currentReleaseId = explode('/', trim($process->getOutput()));