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:
authorStan Hu <stanhu@gmail.com>2017-06-24 07:01:32 +0300
committerStan Hu <stanhu@gmail.com>2017-06-26 18:13:46 +0300
commit1a47bd37a1bc4b33980ba0c97bae9ba54b8d2cfb (patch)
tree60e124b311a8335f358dff2d56eb73a2b7406224 /spec/support
parent47face017562b160dba2c9bb5d7b9e75f605f721 (diff)
Reset the state of StubENV's @env_already_stubbed after each spec run
In certain combination of tests, @env_already_stubbed could be set to `true` even though it never ran for that specific test.
Diffstat (limited to 'spec/support')
-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