Add specificatin for Mutant::CLI.run under exceptions

This commit is contained in:
Markus Schirp 2014-07-06 22:33:08 +00:00
parent 290b92c6a7
commit c986cedd84

View file

@ -45,6 +45,20 @@ describe Mutant::CLI do
expect(subject).to be(1) expect(subject).to be(1)
end end
end end
context 'when execution raises an Mutant::CLI::Error' do
let(:exception) { Mutant::CLI::Error.new('test-error') }
let(:report_success) { nil }
before do
expect(report).to receive(:success?).and_raise(exception)
end
it 'exits failure' do
expect($stderr).to receive(:puts).with('test-error')
expect(subject).to be(1)
end
end
end end
describe '.new' do describe '.new' do