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.
This commit is contained in:
Gabriel Mazetto 2018-08-15 01:39:59 +02:00
parent 010fbedb61
commit 696a5fce68
3 changed files with 1 additions and 13 deletions

View File

@ -10,9 +10,6 @@ describe Gitlab::BareRepositoryImport::Importer, :seed_helper do
subject(:importer) { described_class.new(admin, bare_repository) }
before do
@rainbow = Rainbow.enabled
Rainbow.enabled = false
allow(described_class).to receive(:log)
end
@ -20,7 +17,6 @@ describe Gitlab::BareRepositoryImport::Importer, :seed_helper do
FileUtils.rm_rf(base_dir)
TestEnv.clean_test_path
ensure_seeds
Rainbow.enabled = @rainbow
end
shared_examples 'importing a repository' do

View File

@ -98,15 +98,6 @@ describe SystemCheck::SimpleExecutor 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')

View File

@ -29,6 +29,7 @@ end
# require rainbow gem String monkeypatch, so we can test SystemChecks
require 'rainbow/ext/string'
Rainbow.enabled = false
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.