Disable rainbow during SimpleExecutor specs to have consistence
This commit is contained in:
parent
b0f2861c3d
commit
758e020019
|
@ -84,6 +84,15 @@ describe SystemCheck::SimpleExecutor, lib: true do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
before do
|
||||||
|
@rainbow = Rainbow.enabled
|
||||||
|
Rainbow.enabled = false
|
||||||
|
end
|
||||||
|
|
||||||
|
after do
|
||||||
|
Rainbow.enabled = @rainbow
|
||||||
|
end
|
||||||
|
|
||||||
describe '#component' do
|
describe '#component' do
|
||||||
it 'returns stored component name' do
|
it 'returns stored component name' do
|
||||||
expect(subject.component).to eq('Test')
|
expect(subject.component).to eq('Test')
|
||||||
|
@ -147,14 +156,14 @@ describe SystemCheck::SimpleExecutor, lib: true do
|
||||||
context 'when check pass' do
|
context 'when check pass' do
|
||||||
it 'prints yes' do
|
it 'prints yes' do
|
||||||
expect_any_instance_of(SimpleCheck).to receive(:check?).and_call_original
|
expect_any_instance_of(SimpleCheck).to receive(:check?).and_call_original
|
||||||
expect { subject.run_check(SimpleCheck) }.to output(/ \.\.\. \e\[32myes/).to_stdout
|
expect { subject.run_check(SimpleCheck) }.to output(/ \.\.\. yes/).to_stdout
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when check fails' do
|
context 'when check fails' do
|
||||||
it 'prints no' do
|
it 'prints no' do
|
||||||
expect_any_instance_of(OtherCheck).to receive(:check?).and_call_original
|
expect_any_instance_of(OtherCheck).to receive(:check?).and_call_original
|
||||||
expect { subject.run_check(OtherCheck) }.to output(/ \.\.\. \e\[31mno/).to_stdout
|
expect { subject.run_check(OtherCheck) }.to output(/ \.\.\. no/).to_stdout
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'displays error message from #show_error' do
|
it 'displays error message from #show_error' do
|
||||||
|
|
Loading…
Reference in New Issue