summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Mazetto <brodock@gmail.com>2017-06-27 20:18:23 +0200
committerGabriel Mazetto <brodock@gmail.com>2017-06-27 20:20:57 +0200
commit758e020019860c611237e23a8898fa59c9bca5eb (patch)
tree680b3348b8fed2fcaa01921c6315749ef99b62df
parentb0f2861c3dd662a82ecbf535d1c259ad81df378b (diff)
downloadgitlab-ce-backport-system-check-fix.tar.gz
Disable rainbow during SimpleExecutor specs to have consistencebackport-system-check-fix
-rw-r--r--spec/lib/system_check/simple_executor_spec.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/spec/lib/system_check/simple_executor_spec.rb b/spec/lib/system_check/simple_executor_spec.rb
index 5de768d99ed..795f11ee1f8 100644
--- a/spec/lib/system_check/simple_executor_spec.rb
+++ b/spec/lib/system_check/simple_executor_spec.rb
@@ -84,6 +84,15 @@ describe SystemCheck::SimpleExecutor, lib: true do
end
end
+ before do
+ @rainbow = Rainbow.enabled
+ Rainbow.enabled = false
+ end
+
+ after do
+ Rainbow.enabled = @rainbow
+ end
+
describe '#component' do
it 'returns stored component name' do
expect(subject.component).to eq('Test')
@@ -147,14 +156,14 @@ describe SystemCheck::SimpleExecutor, lib: true do
context 'when check pass' do
it 'prints yes' do
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
context 'when check fails' do
it 'prints no' do
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
it 'displays error message from #show_error' do