Add specificatin for Mutant::CLI.run under exceptions
This commit is contained in:
parent
290b92c6a7
commit
c986cedd84
1 changed files with 14 additions and 0 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue