Improve CLI error reporting

This commit is contained in:
Thibault Jouan
2014-10-11 17:34:19 +00:00
parent f6237bfc0c
commit 25d03d4322
8 changed files with 142 additions and 7 deletions

View File

@@ -44,7 +44,7 @@ module Producer::Core
end
end
context 'when a runtime error is raised' do
context 'when an error is raised' do
let(:recipe_file) { fixture_path_for 'recipes/raise.rb' }
it 'exits with a return status of 70' do
@@ -52,9 +52,9 @@ module Producer::Core
.to raise_error(SystemExit) { |e| expect(e.status).to eq 70 }
end
it 'prints exception name and message and the error stream' do
it 'prints a report to the error stream' do
expect { trap_exit { run! } }
.to output("RemoteCommandExecutionError: false\n").to_stderr
.to output(/\ARemoteCommandExecutionError: false$/).to_stderr
end
end
end