diff options
author | Gabriel Mazetto <brodock@gmail.com> | 2018-08-15 02:39:59 +0300 |
---|---|---|
committer | Gabriel Mazetto <brodock@gmail.com> | 2018-08-16 22:31:19 +0300 |
commit | 696a5fce687364ec718eeef44d923a686c9e1624 (patch) | |
tree | 040b44779ce36d21df32adc13d909942ed15ec37 | |
parent | 010fbedb61334a303d26164de905d9d421871ff2 (diff) |
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.
-rw-r--r-- | spec/lib/gitlab/bare_repository_import/importer_spec.rb | 4 | ||||
-rw-r--r-- | spec/lib/system_check/simple_executor_spec.rb | 9 | ||||
-rw-r--r-- | spec/spec_helper.rb | 1 |
3 files changed, 1 insertions, 13 deletions
diff --git a/spec/lib/gitlab/bare_repository_import/importer_spec.rb b/spec/lib/gitlab/bare_repository_import/importer_spec.rb index 6e21c846c0a..3c63e601abc 100644 --- a/spec/lib/gitlab/bare_repository_import/importer_spec.rb +++ b/spec/lib/gitlab/bare_repository_import/importer_spec.rb @@ -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 diff --git a/spec/lib/system_check/simple_executor_spec.rb b/spec/lib/system_check/simple_executor_spec.rb index 9da3648400e..e71e9da369d 100644 --- a/spec/lib/system_check/simple_executor_spec.rb +++ b/spec/lib/system_check/simple_executor_spec.rb @@ -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') diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index f4441a6b700..a15a46a9534 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -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. |