Commit 696a5fce authored by Gabriel Mazetto's avatar Gabriel Mazetto

Refactor Rainbow usage in specs

We don't test any specific string generated by it yet, so there is no
point in keeping it enabled when we are disabling it everywhere we test its output.
parent 010fbedb
...@@ -10,9 +10,6 @@ describe Gitlab::BareRepositoryImport::Importer, :seed_helper do ...@@ -10,9 +10,6 @@ describe Gitlab::BareRepositoryImport::Importer, :seed_helper do
subject(:importer) { described_class.new(admin, bare_repository) } subject(:importer) { described_class.new(admin, bare_repository) }
before do before do
@rainbow = Rainbow.enabled
Rainbow.enabled = false
allow(described_class).to receive(:log) allow(described_class).to receive(:log)
end end
...@@ -20,7 +17,6 @@ describe Gitlab::BareRepositoryImport::Importer, :seed_helper do ...@@ -20,7 +17,6 @@ describe Gitlab::BareRepositoryImport::Importer, :seed_helper do
FileUtils.rm_rf(base_dir) FileUtils.rm_rf(base_dir)
TestEnv.clean_test_path TestEnv.clean_test_path
ensure_seeds ensure_seeds
Rainbow.enabled = @rainbow
end end
shared_examples 'importing a repository' do shared_examples 'importing a repository' do
......
...@@ -98,15 +98,6 @@ describe SystemCheck::SimpleExecutor do ...@@ -98,15 +98,6 @@ describe SystemCheck::SimpleExecutor 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')
......
...@@ -29,6 +29,7 @@ end ...@@ -29,6 +29,7 @@ end
# require rainbow gem String monkeypatch, so we can test SystemChecks # require rainbow gem String monkeypatch, so we can test SystemChecks
require 'rainbow/ext/string' require 'rainbow/ext/string'
Rainbow.enabled = false
# Requires supporting ruby files with custom matchers and macros, etc, # Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories. # in spec/support/ and its subdirectories.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment