Commit 2765abfa authored by Arturo Herrero's avatar Arturo Herrero

RSpec zero monkey patching mode

The plan for RSpec 4.0 is to disable monkey patching, reference:
https://rspec.info/blog/2013/07/the-plan-for-rspec-3/#zero-monkey-patching-mode
https://relishapp.com/rspec/rspec-core/docs/configuration/zero-monkey-patching-mode

This commit stops using RSpec monkey patching in several specs.
parent c7dc919c
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Build::Action do RSpec.describe Gitlab::Ci::Status::Build::Action do
let(:status) { double('core status') } let(:status) { double('core status') }
let(:user) { double('user') } let(:user) { double('user') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Build::Cancelable do RSpec.describe Gitlab::Ci::Status::Build::Cancelable do
let(:status) { double('core status') } let(:status) { double('core status') }
let(:user) { double('user') } let(:user) { double('user') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Build::Canceled do RSpec.describe Gitlab::Ci::Status::Build::Canceled do
let(:user) { create(:user) } let(:user) { create(:user) }
subject do subject do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Build::Common do RSpec.describe Gitlab::Ci::Status::Build::Common do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:build) { create(:ci_build) } let(:build) { create(:ci_build) }
let(:project) { build.project } let(:project) { build.project }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Build::Created do RSpec.describe Gitlab::Ci::Status::Build::Created do
let(:user) { create(:user) } let(:user) { create(:user) }
subject do subject do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Build::Erased do RSpec.describe Gitlab::Ci::Status::Build::Erased do
let(:user) { create(:user) } let(:user) { create(:user) }
subject do subject do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Build::Factory do RSpec.describe Gitlab::Ci::Status::Build::Factory do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { build.project } let(:project) { build.project }
let(:status) { factory.fabricate! } let(:status) { factory.fabricate! }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Build::FailedAllowed do RSpec.describe Gitlab::Ci::Status::Build::FailedAllowed do
let(:status) { double('core status') } let(:status) { double('core status') }
let(:user) { double('user') } let(:user) { double('user') }
let(:build) { create(:ci_build, :failed, :allowed_to_fail) } let(:build) { create(:ci_build, :failed, :allowed_to_fail) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Build::Failed do RSpec.describe Gitlab::Ci::Status::Build::Failed do
let(:build) { create(:ci_build, :script_failure) } let(:build) { create(:ci_build, :script_failure) }
let(:status) { double('core status') } let(:status) { double('core status') }
let(:user) { double('user') } let(:user) { double('user') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Build::Manual do RSpec.describe Gitlab::Ci::Status::Build::Manual do
let(:user) { create(:user) } let(:user) { create(:user) }
subject do subject do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Build::Pending do RSpec.describe Gitlab::Ci::Status::Build::Pending do
let(:user) { create(:user) } let(:user) { create(:user) }
subject do subject do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Build::Play do RSpec.describe Gitlab::Ci::Status::Build::Play do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :stubbed_repository) } let(:project) { create(:project, :stubbed_repository) }
let(:build) { create(:ci_build, :manual, project: project) } let(:build) { create(:ci_build, :manual, project: project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Build::Preparing do RSpec.describe Gitlab::Ci::Status::Build::Preparing do
subject do subject do
described_class.new(double('subject')) described_class.new(double('subject'))
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Build::Retried do RSpec.describe Gitlab::Ci::Status::Build::Retried do
let(:build) { create(:ci_build, :retried) } let(:build) { create(:ci_build, :retried) }
let(:status) { double('core status') } let(:status) { double('core status') }
let(:user) { double('user') } let(:user) { double('user') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Build::Retryable do RSpec.describe Gitlab::Ci::Status::Build::Retryable do
let(:status) { double('core status') } let(:status) { double('core status') }
let(:user) { double('user') } let(:user) { double('user') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Build::Scheduled do RSpec.describe Gitlab::Ci::Status::Build::Scheduled do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :stubbed_repository) } let(:project) { create(:project, :stubbed_repository) }
let(:build) { create(:ci_build, :scheduled, project: project) } let(:build) { create(:ci_build, :scheduled, project: project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Build::Skipped do RSpec.describe Gitlab::Ci::Status::Build::Skipped do
let(:user) { create(:user) } let(:user) { create(:user) }
subject do subject do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Build::Stop do RSpec.describe Gitlab::Ci::Status::Build::Stop do
let(:status) { double('core status') } let(:status) { double('core status') }
let(:user) { double('user') } let(:user) { double('user') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Build::Unschedule do RSpec.describe Gitlab::Ci::Status::Build::Unschedule do
let(:status) { double('core status') } let(:status) { double('core status') }
let(:user) { double('user') } let(:user) { double('user') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Canceled do RSpec.describe Gitlab::Ci::Status::Canceled do
subject do subject do
described_class.new(double('subject'), double('user')) described_class.new(double('subject'), double('user'))
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Composite do RSpec.describe Gitlab::Ci::Status::Composite do
let_it_be(:pipeline) { create(:ci_pipeline) } let_it_be(:pipeline) { create(:ci_pipeline) }
before_all do before_all do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Created do RSpec.describe Gitlab::Ci::Status::Created do
subject do subject do
described_class.new(double('subject'), double('user')) described_class.new(double('subject'), double('user'))
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Extended do RSpec.describe Gitlab::Ci::Status::Extended do
it 'requires subclass to implement matcher' do it 'requires subclass to implement matcher' do
expect { described_class.matches?(double, double) } expect { described_class.matches?(double, double) }
.to raise_error(NotImplementedError) .to raise_error(NotImplementedError)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::External::Common do RSpec.describe Gitlab::Ci::Status::External::Common do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { external_status.project } let(:project) { external_status.project }
let(:external_target_url) { 'http://example.gitlab.com/status' } let(:external_target_url) { 'http://example.gitlab.com/status' }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::External::Factory do RSpec.describe Gitlab::Ci::Status::External::Factory do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { resource.project } let(:project) { resource.project }
let(:status) { factory.fabricate! } let(:status) { factory.fabricate! }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Factory do RSpec.describe Gitlab::Ci::Status::Factory do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:fabricated_status) { factory.fabricate! } let(:fabricated_status) { factory.fabricate! }
let(:factory) { described_class.new(resource, user) } let(:factory) { described_class.new(resource, user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Failed do RSpec.describe Gitlab::Ci::Status::Failed do
subject do subject do
described_class.new(double('subject'), double('user')) described_class.new(double('subject'), double('user'))
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Group::Common do RSpec.describe Gitlab::Ci::Status::Group::Common do
subject do subject do
Gitlab::Ci::Status::Core.new(double, double) Gitlab::Ci::Status::Core.new(double, double)
.extend(described_class) .extend(described_class)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Group::Factory do RSpec.describe Gitlab::Ci::Status::Group::Factory do
it 'inherits from the core factory' do it 'inherits from the core factory' do
expect(described_class) expect(described_class)
.to be < Gitlab::Ci::Status::Factory .to be < Gitlab::Ci::Status::Factory
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Manual do RSpec.describe Gitlab::Ci::Status::Manual do
subject do subject do
described_class.new(double('subject'), double('user')) described_class.new(double('subject'), double('user'))
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Pending do RSpec.describe Gitlab::Ci::Status::Pending do
subject do subject do
described_class.new(double('subject'), double('user')) described_class.new(double('subject'), double('user'))
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Pipeline::Blocked do RSpec.describe Gitlab::Ci::Status::Pipeline::Blocked do
let(:pipeline) { double('pipeline') } let(:pipeline) { double('pipeline') }
subject do subject do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Pipeline::Common do RSpec.describe Gitlab::Ci::Status::Pipeline::Common do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :private) } let(:project) { create(:project, :private) }
let(:pipeline) { create(:ci_pipeline, project: project) } let(:pipeline) { create(:ci_pipeline, project: project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Pipeline::Delayed do RSpec.describe Gitlab::Ci::Status::Pipeline::Delayed do
let(:pipeline) { double('pipeline') } let(:pipeline) { double('pipeline') }
subject do subject do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Pipeline::Factory do RSpec.describe Gitlab::Ci::Status::Pipeline::Factory do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { pipeline.project } let(:project) { pipeline.project }
let(:status) { factory.fabricate! } let(:status) { factory.fabricate! }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Preparing do RSpec.describe Gitlab::Ci::Status::Preparing do
subject do subject do
described_class.new(double('subject'), nil) described_class.new(double('subject'), nil)
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Running do RSpec.describe Gitlab::Ci::Status::Running do
subject do subject do
described_class.new(double('subject'), double('user')) described_class.new(double('subject'), double('user'))
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Scheduled do RSpec.describe Gitlab::Ci::Status::Scheduled do
subject do subject do
described_class.new(double('subject'), double('user')) described_class.new(double('subject'), double('user'))
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Skipped do RSpec.describe Gitlab::Ci::Status::Skipped do
subject do subject do
described_class.new(double('subject'), double('user')) described_class.new(double('subject'), double('user'))
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Stage::Common do RSpec.describe Gitlab::Ci::Status::Stage::Common do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project) }
let(:pipeline) { create(:ci_empty_pipeline, project: project) } let(:pipeline) { create(:ci_empty_pipeline, project: project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Stage::Factory do RSpec.describe Gitlab::Ci::Status::Stage::Factory do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project) }
let(:pipeline) { create(:ci_empty_pipeline, project: project) } let(:pipeline) { create(:ci_empty_pipeline, project: project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Stage::PlayManual do RSpec.describe Gitlab::Ci::Status::Stage::PlayManual do
let(:stage) { double('stage') } let(:stage) { double('stage') }
let(:play_manual) { described_class.new(stage) } let(:play_manual) { described_class.new(stage) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::Success do RSpec.describe Gitlab::Ci::Status::Success do
subject do subject do
described_class.new(double('subject'), double('user')) described_class.new(double('subject'), double('user'))
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::SuccessWarning do RSpec.describe Gitlab::Ci::Status::SuccessWarning do
let(:status) { double('status') } let(:status) { double('status') }
subject do subject do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Status::WaitingForResource do RSpec.describe Gitlab::Ci::Status::WaitingForResource do
subject do subject do
described_class.new(double('subject'), double('user')) described_class.new(double('subject'), double('user'))
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe 'Jobs/Browser-Performance-Testing.gitlab-ci.yml' do RSpec.describe 'Jobs/Browser-Performance-Testing.gitlab-ci.yml' do
subject(:template) do subject(:template) do
<<~YAML <<~YAML
stages: stages:
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe 'Jobs/Build.gitlab-ci.yml' do RSpec.describe 'Jobs/Build.gitlab-ci.yml' do
subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Jobs/Build') } subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Jobs/Build') }
describe 'the created pipeline' do describe 'the created pipeline' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe 'Jobs/Code-Quality.gitlab-ci.yml' do RSpec.describe 'Jobs/Code-Quality.gitlab-ci.yml' do
subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Jobs/Code-Quality') } subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Jobs/Code-Quality') }
describe 'the created pipeline' do describe 'the created pipeline' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe 'Jobs/Deploy.gitlab-ci.yml' do RSpec.describe 'Jobs/Deploy.gitlab-ci.yml' do
subject(:template) do subject(:template) do
<<~YAML <<~YAML
stages: stages:
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe 'Jobs/Test.gitlab-ci.yml' do RSpec.describe 'Jobs/Test.gitlab-ci.yml' do
subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Jobs/Test') } subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Jobs/Test') }
describe 'the created pipeline' do describe 'the created pipeline' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe 'Auto-DevOps.gitlab-ci.yml' do RSpec.describe 'Auto-DevOps.gitlab-ci.yml' do
subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Auto-DevOps') } subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Auto-DevOps') }
describe 'the created pipeline' do describe 'the created pipeline' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe 'Managed-Cluster-Applications.gitlab-ci.yml' do RSpec.describe 'Managed-Cluster-Applications.gitlab-ci.yml' do
subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Managed-Cluster-Applications') } subject(:template) { Gitlab::Template::GitlabCiYmlTemplate.find('Managed-Cluster-Applications') }
describe 'the created pipeline' do describe 'the created pipeline' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe 'CI YML Templates' do RSpec.describe 'CI YML Templates' do
subject { Gitlab::Ci::YamlProcessor.new(content) } subject { Gitlab::Ci::YamlProcessor.new(content) }
let(:all_templates) { Gitlab::Template::GitlabCiYmlTemplate.all.map(&:full_name) } let(:all_templates) { Gitlab::Template::GitlabCiYmlTemplate.all.map(&:full_name) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Trace::ChunkedIO, :clean_gitlab_redis_cache do RSpec.describe Gitlab::Ci::Trace::ChunkedIO, :clean_gitlab_redis_cache do
include ChunkedIOHelpers include ChunkedIOHelpers
let_it_be(:build) { create(:ci_build, :running) } let_it_be(:build) { create(:ci_build, :running) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Trace::SectionParser do RSpec.describe Gitlab::Ci::Trace::SectionParser do
def lines_with_pos(text) def lines_with_pos(text)
pos = 0 pos = 0
StringIO.new(text).each_line do |line| StringIO.new(text).each_line do |line|
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Trace::Stream, :clean_gitlab_redis_cache do RSpec.describe Gitlab::Ci::Trace::Stream, :clean_gitlab_redis_cache do
let_it_be(:build) { create(:ci_build, :running) } let_it_be(:build) { create(:ci_build, :running) }
before do before do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Trace, :clean_gitlab_redis_shared_state do RSpec.describe Gitlab::Ci::Trace, :clean_gitlab_redis_shared_state do
let(:build) { create(:ci_build) } let(:build) { create(:ci_build) }
let(:trace) { described_class.new(build) } let(:trace) { described_class.new(build) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Variables::Collection::Item do RSpec.describe Gitlab::Ci::Variables::Collection::Item do
let(:variable_key) { 'VAR' } let(:variable_key) { 'VAR' }
let(:variable_value) { 'something' } let(:variable_value) { 'something' }
let(:expected_value) { variable_value } let(:expected_value) { variable_value }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Ci::Variables::Collection do RSpec.describe Gitlab::Ci::Variables::Collection do
describe '.new' do describe '.new' do
it 'can be initialized with an array' do it 'can be initialized with an array' do
variable = { key: 'VAR', value: 'value', public: true, masked: false } variable = { key: 'VAR', value: 'value', public: true, masked: false }
......
...@@ -4,7 +4,7 @@ require 'spec_helper' ...@@ -4,7 +4,7 @@ require 'spec_helper'
module Gitlab module Gitlab
module Ci module Ci
describe YamlProcessor do RSpec.describe YamlProcessor do
include StubRequests include StubRequests
subject { described_class.new(config, user: nil) } subject { described_class.new(config, user: nil) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::CiAccess do RSpec.describe Gitlab::CiAccess do
let(:access) { described_class.new } let(:access) { described_class.new }
describe '#can_do_action?' do describe '#can_do_action?' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Cleanup::OrphanJobArtifactFilesBatch do RSpec.describe Gitlab::Cleanup::OrphanJobArtifactFilesBatch do
let(:batch_size) { 10 } let(:batch_size) { 10 }
let(:dry_run) { true } let(:dry_run) { true }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Cleanup::OrphanJobArtifactFiles do RSpec.describe Gitlab::Cleanup::OrphanJobArtifactFiles do
let(:null_logger) { Logger.new('/dev/null') } let(:null_logger) { Logger.new('/dev/null') }
subject(:cleanup) { described_class.new(logger: null_logger) } subject(:cleanup) { described_class.new(logger: null_logger) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Cleanup::OrphanLfsFileReferences do RSpec.describe Gitlab::Cleanup::OrphanLfsFileReferences do
let(:null_logger) { Logger.new('/dev/null') } let(:null_logger) { Logger.new('/dev/null') }
let(:project) { create(:project, :repository, lfs_enabled: true) } let(:project) { create(:project, :repository, lfs_enabled: true) }
let(:lfs_object) { create(:lfs_object) } let(:lfs_object) { create(:lfs_object) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Cleanup::ProjectUploads do RSpec.describe Gitlab::Cleanup::ProjectUploads do
subject { described_class.new(logger: logger) } subject { described_class.new(logger: logger) }
let(:logger) { double(:logger) } let(:logger) { double(:logger) }
......
# frozen_string_literal: true # frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe Gitlab::Cleanup::RemoteUploads do RSpec.describe Gitlab::Cleanup::RemoteUploads do
context 'when object_storage is enabled' do context 'when object_storage is enabled' do
let(:connection) { double } let(:connection) { double }
let(:directory) { double } let(:directory) { double }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::ClosingIssueExtractor do RSpec.describe Gitlab::ClosingIssueExtractor do
let(:project) { create(:project) } let(:project) { create(:project) }
let(:project2) { create(:project) } let(:project2) { create(:project) }
let(:forked_project) { Projects::ForkService.new(project, project2.creator).execute } let(:forked_project) { Projects::ForkService.new(project, project2.creator).execute }
......
...@@ -4,7 +4,7 @@ require 'spec_helper' ...@@ -4,7 +4,7 @@ require 'spec_helper'
# For easier debugging set `PUMA_DEBUG=1` # For easier debugging set `PUMA_DEBUG=1`
describe Gitlab::Cluster::Mixins::PumaCluster do RSpec.describe Gitlab::Cluster::Mixins::PumaCluster do
before do before do
stub_const('PUMA_STARTUP_TIMEOUT', 30) stub_const('PUMA_STARTUP_TIMEOUT', 30)
end end
......
...@@ -4,7 +4,7 @@ require 'spec_helper' ...@@ -4,7 +4,7 @@ require 'spec_helper'
# For easier debugging set `UNICORN_DEBUG=1` # For easier debugging set `UNICORN_DEBUG=1`
describe Gitlab::Cluster::Mixins::UnicornHttpServer do RSpec.describe Gitlab::Cluster::Mixins::UnicornHttpServer do
before do before do
stub_const('UNICORN_STARTUP_TIMEOUT', 30) stub_const('UNICORN_STARTUP_TIMEOUT', 30)
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Cluster::PumaWorkerKillerObserver do RSpec.describe Gitlab::Cluster::PumaWorkerKillerObserver do
let(:counter) { Gitlab::Metrics::NullMetric.instance } let(:counter) { Gitlab::Metrics::NullMetric.instance }
before do before do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Cluster::RackTimeoutObserver do RSpec.describe Gitlab::Cluster::RackTimeoutObserver do
let(:counter) { Gitlab::Metrics::NullMetric.instance } let(:counter) { Gitlab::Metrics::NullMetric.instance }
before do before do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::CodeNavigationPath do RSpec.describe Gitlab::CodeNavigationPath do
context 'when there is an artifact with code navigation data' do context 'when there is an artifact with code navigation data' do
let_it_be(:project) { create(:project, :repository) } let_it_be(:project) { create(:project, :repository) }
let_it_be(:sha) { project.repository.commits('master', limit: 5).last.id } let_it_be(:sha) { project.repository.commits('master', limit: 5).last.id }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::ColorSchemes do RSpec.describe Gitlab::ColorSchemes do
describe '.body_classes' do describe '.body_classes' do
it 'returns a space-separated list of class names' do it 'returns a space-separated list of class names' do
css = described_class.body_classes css = described_class.body_classes
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Config::Entry::Attributable do RSpec.describe Gitlab::Config::Entry::Attributable do
let(:node) do let(:node) do
Class.new do Class.new do
include Gitlab::Config::Entry::Attributable include Gitlab::Config::Entry::Attributable
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Config::Entry::Boolean do RSpec.describe Gitlab::Config::Entry::Boolean do
let(:entry) { described_class.new(config) } let(:entry) { described_class.new(config) }
describe 'validations' do describe 'validations' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Config::Entry::Configurable do RSpec.describe Gitlab::Config::Entry::Configurable do
let(:entry) do let(:entry) do
Class.new(Gitlab::Config::Entry::Node) do Class.new(Gitlab::Config::Entry::Node) do
include Gitlab::Config::Entry::Configurable include Gitlab::Config::Entry::Configurable
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Config::Entry::Factory do RSpec.describe Gitlab::Config::Entry::Factory do
describe '#create!' do describe '#create!' do
before do before do
stub_const('Script', Class.new(Gitlab::Config::Entry::Node)) stub_const('Script', Class.new(Gitlab::Config::Entry::Node))
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Config::Entry::Simplifiable do RSpec.describe Gitlab::Config::Entry::Simplifiable do
describe '.strategy' do describe '.strategy' do
let(:entry) do let(:entry) do
Class.new(described_class) do Class.new(described_class) do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Config::Entry::Undefined do RSpec.describe Gitlab::Config::Entry::Undefined do
let(:entry) { described_class.new } let(:entry) { described_class.new }
describe '#leaf?' do describe '#leaf?' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Config::Entry::Unspecified do RSpec.describe Gitlab::Config::Entry::Unspecified do
let(:unspecified) { described_class.new(entry) } let(:unspecified) { described_class.new(entry) }
let(:entry) { spy('Entry') } let(:entry) { spy('Entry') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Config::Entry::Validatable do RSpec.describe Gitlab::Config::Entry::Validatable do
let(:entry) do let(:entry) do
Class.new(Gitlab::Config::Entry::Node) do Class.new(Gitlab::Config::Entry::Node) do
include Gitlab::Config::Entry::Validatable include Gitlab::Config::Entry::Validatable
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Config::Entry::Validator do RSpec.describe Gitlab::Config::Entry::Validator do
let(:validator) { Class.new(described_class) } let(:validator) { Class.new(described_class) }
let(:validator_instance) { validator.new(node) } let(:validator_instance) { validator.new(node) }
let(:node) { spy('node') } let(:node) { spy('node') }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Config::Loader::Yaml do RSpec.describe Gitlab::Config::Loader::Yaml do
let(:loader) { described_class.new(yml) } let(:loader) { described_class.new(yml) }
let(:yml) do let(:yml) do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::ConfigChecker::ExternalDatabaseChecker do RSpec.describe Gitlab::ConfigChecker::ExternalDatabaseChecker do
describe '#check' do describe '#check' do
subject { described_class.check } subject { described_class.check }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::ConfigChecker::PumaRuggedChecker do RSpec.describe Gitlab::ConfigChecker::PumaRuggedChecker do
describe '#check' do describe '#check' do
subject { described_class.check } subject { described_class.check }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Conflict::FileCollection do RSpec.describe Gitlab::Conflict::FileCollection do
let(:merge_request) { create(:merge_request, source_branch: 'conflict-resolvable', target_branch: 'conflict-start') } let(:merge_request) { create(:merge_request, source_branch: 'conflict-resolvable', target_branch: 'conflict-start') }
let(:file_collection) { described_class.new(merge_request) } let(:file_collection) { described_class.new(merge_request) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::Conflict::File do RSpec.describe Gitlab::Conflict::File do
include GitHelpers include GitHelpers
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::ContentSecurityPolicy::ConfigLoader do RSpec.describe Gitlab::ContentSecurityPolicy::ConfigLoader do
let(:policy) { ActionDispatch::ContentSecurityPolicy.new } let(:policy) { ActionDispatch::ContentSecurityPolicy.new }
let(:csp_config) do let(:csp_config) do
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::ContributionsCalendar do RSpec.describe Gitlab::ContributionsCalendar do
let(:contributor) { create(:user) } let(:contributor) { create(:user) }
let(:user) { create(:user) } let(:user) { create(:user) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::CrossProjectAccess::CheckCollection do RSpec.describe Gitlab::CrossProjectAccess::CheckCollection do
subject(:collection) { described_class.new } subject(:collection) { described_class.new }
describe '#add_collection' do describe '#add_collection' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::CrossProjectAccess::CheckInfo do RSpec.describe Gitlab::CrossProjectAccess::CheckInfo do
let(:dummy_controller) { double } let(:dummy_controller) { double }
before do before do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::CrossProjectAccess::ClassMethods do RSpec.describe Gitlab::CrossProjectAccess::ClassMethods do
let(:dummy_class) do let(:dummy_class) do
Class.new do Class.new do
extend Gitlab::CrossProjectAccess::ClassMethods extend Gitlab::CrossProjectAccess::ClassMethods
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::CrossProjectAccess do RSpec.describe Gitlab::CrossProjectAccess do
let(:super_class) { Class.new } let(:super_class) { Class.new }
let(:descendant_class) { Class.new(super_class) } let(:descendant_class) { Class.new(super_class) }
let(:current_instance) { described_class.new } let(:current_instance) { described_class.new }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::CryptoHelper do RSpec.describe Gitlab::CryptoHelper do
describe '.sha256' do describe '.sha256' do
it 'generates SHA256 digest Base46 encoded' do it 'generates SHA256 digest Base46 encoded' do
digest = described_class.sha256('some-value') digest = described_class.sha256('some-value')
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::CurrentSettings do RSpec.describe Gitlab::CurrentSettings do
before do before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false') stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
end end
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::CycleAnalytics::BaseEventFetcher do RSpec.describe Gitlab::CycleAnalytics::BaseEventFetcher do
let(:max_events) { 2 } let(:max_events) { 2 }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:user) { create(:user, :admin) } let(:user) { create(:user, :admin) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::CycleAnalytics::CodeEventFetcher do RSpec.describe Gitlab::CycleAnalytics::CodeEventFetcher do
let(:stage_name) { :code } let(:stage_name) { :code }
it_behaves_like 'default query config' do it_behaves_like 'default query config' do
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::CycleAnalytics::CodeStage do RSpec.describe Gitlab::CycleAnalytics::CodeStage do
let(:stage_name) { :code } let(:stage_name) { :code }
let(:project) { create(:project) } let(:project) { create(:project) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe 'cycle analytics events' do RSpec.describe 'cycle analytics events' do
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:from_date) { 10.days.ago } let(:from_date) { 10.days.ago }
let(:user) { create(:user, :admin) } let(:user) { create(:user, :admin) }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
describe Gitlab::CycleAnalytics::IssueEventFetcher do RSpec.describe Gitlab::CycleAnalytics::IssueEventFetcher do
let(:stage_name) { :issue } let(:stage_name) { :issue }
it_behaves_like 'default query config' it_behaves_like 'default query config'
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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