Commit bb6c94a5 authored by Matthias Käppler's avatar Matthias Käppler

Merge branch 'pl-spec-sidekiq-cli-settings-reload' into 'master'

Extract stub_settings_source into spec support file

See merge request gitlab-org/gitlab!78689
parents dc92da09 bcb852e9
......@@ -3,9 +3,10 @@
require 'fast_spec_helper'
require 'rspec-parameterized'
require_relative '../../support/stub_settings_source'
require_relative '../../../sidekiq_cluster/cli'
RSpec.describe Gitlab::SidekiqCluster::CLI, stubbing_settings_source: true do # rubocop:disable RSpec/FilePath
RSpec.describe Gitlab::SidekiqCluster::CLI, stub_settings_source: true do # rubocop:disable RSpec/FilePath
let(:cli) { described_class.new('/dev/null') }
let(:timeout) { Gitlab::SidekiqCluster::DEFAULT_SOFT_TIMEOUT_SECONDS }
let(:default_options) do
......
......@@ -462,14 +462,6 @@ RSpec.configure do |config|
$stdout = STDOUT
end
config.around(:each, stubbing_settings_source: true) do |example|
original_instance = ::Settings.instance_variable_get(:@instance)
example.run
::Settings.instance_variable_set(:@instance, original_instance)
end
config.disable_monkey_patching!
end
......
# frozen_string_literal: true
RSpec.configure do |config|
config.around(:each, stub_settings_source: true) do |example|
original_instance = ::Settings.instance_variable_get(:@instance)
example.run
::Settings.instance_variable_set(:@instance, original_instance)
end
end
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