diff --git a/i18n/en.xliff.dist b/i18n/en.xliff.dist index c7697030..54e63bb8 100644 --- a/i18n/en.xliff.dist +++ b/i18n/en.xliff.dist @@ -145,6 +145,10 @@ (I )execute :command from project root + + (I )display the last command output + + command should succeed diff --git a/src/Context/SystemContext.php b/src/Context/SystemContext.php index 1799bc51..3c9fa5fe 100644 --- a/src/Context/SystemContext.php +++ b/src/Context/SystemContext.php @@ -48,6 +48,16 @@ public function iExecuteFromProjectRoot($cmd) $this->iExecute($cmd); } + /** + * Display the last command output + * + * @Then (I )display the last command output + */ + public function iDumpCommandOutput() + { + echo implode(PHP_EOL, $this->output); + } + /** * Command should succeed * diff --git a/tests/features/system.feature b/tests/features/system.feature index 194bf8e9..f516360a 100644 --- a/tests/features/system.feature +++ b/tests/features/system.feature @@ -13,6 +13,10 @@ Feature: System feature Given I execute "sleep 2" Then Command should last more than 1 seconds + Scenario: Testing displaying output + Given I execute "echo 'Hello world'" + Then display the last command output + Scenario: Testing execution output Given I execute "echo 'Hello world'" Then output should contain "Hello world"