Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/stub_settings_source.rb')
-rw-r--r--spec/support/stub_settings_source.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/support/stub_settings_source.rb b/spec/support/stub_settings_source.rb
new file mode 100644
index 00000000000..c0e4e468b90
--- /dev/null
+++ b/spec/support/stub_settings_source.rb
@@ -0,0 +1,11 @@
+# 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