summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2017-06-27 10:18:54 +0000
committerRémy Coutable <remy@rymai.me>2017-06-27 10:18:54 +0000
commit7e9a52d05bf3378c5bb730fd54b4da4db1e705be (patch)
tree4fad7c7e20ccb75f95ce5e40176107a7e74096ea
parentcefa4dc0cff29b5376a640b46978221fe8b0391a (diff)
parent1a47bd37a1bc4b33980ba0c97bae9ba54b8d2cfb (diff)
downloadgitlab-ce-7e9a52d05bf3378c5bb730fd54b4da4db1e705be.tar.gz
Merge branch 'sh-unset-stubenv' into 'master'
Reset the state of StubENV's @env_already_stubbed after each spec run See merge request !12438
-rw-r--r--spec/support/stub_env.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/support/stub_env.rb b/spec/support/stub_env.rb
index 18597b5c71f..2999bcd9fb1 100644
--- a/spec/support/stub_env.rb
+++ b/spec/support/stub_env.rb
@@ -5,3 +5,11 @@ module StubENV
allow(ENV).to receive(:[]).with(key).and_return(value)
end
end
+
+# It's possible that the state of the class variables are not reset across
+# test runs.
+RSpec.configure do |config|
+ config.after(:each) do
+ @env_already_stubbed = nil
+ end
+end