Commit 67ca3bc0 authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'leaky-constant-fix-39' into 'master'

Fix leaky constant in creds factory spec

See merge request gitlab-org/gitlab!32176
parents 88edbd78 d39a2d4f
......@@ -350,10 +350,6 @@ RSpec/LeakyConstantDeclaration:
Exclude:
- 'spec/db/schema_spec.rb'
- 'spec/lib/feature_spec.rb'
- 'spec/lib/gitlab/ci/build/credentials/factory_spec.rb'
- 'spec/lib/gitlab/ci/config/entry/retry_spec.rb'
- 'spec/lib/gitlab/cluster/mixins/puma_cluster_spec.rb'
- 'spec/lib/gitlab/cluster/mixins/unicorn_http_server_spec.rb'
- 'spec/lib/gitlab/config/entry/simplifiable_spec.rb'
- 'spec/lib/gitlab/database/migration_helpers_spec.rb'
- 'spec/lib/gitlab/database/obsolete_ignored_columns_spec.rb'
......
---
title: Fix leaky constant issue in creds factory spec
merge_request: 32176
author: Rajendra Kadam
type: fixed
......@@ -7,11 +7,13 @@ describe Gitlab::Ci::Build::Credentials::Factory do
subject { described_class.new(build).create! }
class TestProvider
def initialize(build); end
end
before do
stub_const('TestProvider', Class.new)
TestProvider.class_eval do
def initialize(build); end
end
allow_next_instance_of(described_class) do |instance|
allow(instance).to receive(:providers).and_return([TestProvider])
end
......
......@@ -94,7 +94,7 @@ describe Gitlab::Ci::Config::Entry::Retry do
# sure this is catched, check explicitly that all of the documented
# values are valid. If they are not it means the documentation and this
# array must be updated.
RETRY_WHEN_IN_DOCUMENTATION = %w[
retry_when_in_documentation = %w[
always
unknown_failure
script_failure
......@@ -111,7 +111,7 @@ describe Gitlab::Ci::Config::Entry::Retry do
data_integrity_failure
].freeze
RETRY_WHEN_IN_DOCUMENTATION.each do |reason|
retry_when_in_documentation.each do |reason|
context "with when from documentation `#{reason}`" do
let(:when) { reason }
......
......@@ -5,7 +5,9 @@ require 'spec_helper'
# For easier debugging set `PUMA_DEBUG=1`
describe Gitlab::Cluster::Mixins::PumaCluster do
PUMA_STARTUP_TIMEOUT = 30
before do
stub_const('PUMA_STARTUP_TIMEOUT', 30)
end
context 'when running Puma in Cluster-mode' do
using RSpec::Parameterized::TableSyntax
......
......@@ -5,7 +5,9 @@ require 'spec_helper'
# For easier debugging set `UNICORN_DEBUG=1`
describe Gitlab::Cluster::Mixins::UnicornHttpServer do
UNICORN_STARTUP_TIMEOUT = 30
before do
stub_const('UNICORN_STARTUP_TIMEOUT', 30)
end
context 'when running Unicorn' do
using RSpec::Parameterized::TableSyntax
......
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