Skip to content
This repository has been archived by the owner on Sep 5, 2020. It is now read-only.

Commit

Permalink
Close #589 - Fixed StepsRunner not halting the running of steps upon …
Browse files Browse the repository at this point in the history
…encountering a strict false
  • Loading branch information
Anahkiasen committed Jul 21, 2016
1 parent 5ad32e9 commit 4df8105
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,7 @@ Rocketeer follows the [Semantic Versioning 2.0](http://semver.org/spec/v2.0.0.ht

### Fixed
- Fixed remote storage being written to in pretend mode
- Fixed `StepsRunner` not halting the running of steps upon encountering a strict false

## [2.2.1] - 2016-07-10

Expand Down
4 changes: 2 additions & 2 deletions src/Rocketeer/Traits/StepsRunner.php
Expand Up @@ -47,10 +47,10 @@ public function runSteps()
$steps = $this->steps()->pullSteps();
foreach ($steps as $step) {
list($method, $arguments) = $step;
$arguments = (array) $arguments;
$arguments = (array) $arguments;

$results = call_user_func_array([$this, $method], $arguments);
$results = $results ?: $this->status();
$results = is_bool($results) ? $results : $this->status();
if (!$results) {
return false;
}
Expand Down
16 changes: 16 additions & 0 deletions tests/Traits/StepsRunnerTest.php
Expand Up @@ -40,4 +40,20 @@ public function testStepsAreClearedOnceRun()
['run', ['php --version']],
], $task->steps()->getSteps());
}

public function testStopsOnStrictFalse()
{
$this->expectOutputString('');

$this->task('Deploy')->steps()->addStep(function () {
return false;
});

$this->task('Deploy')->steps()->addStep(function () {
echo 'foobar';
return true;
});

$this->task('Deploy')->runSteps();
}
}

0 comments on commit 4df8105

Please sign in to comment.