Skip to content

Commit

Permalink
Add ENV recovery after clearing during test run
Browse files Browse the repository at this point in the history
It affects tests which execute `rails runner`
  • Loading branch information
vovanmozg committed Mar 30, 2024
1 parent b43c196 commit d25a628
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/config_env_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@
Config.load_files "#{fixture_path}/settings.yml", "#{fixture_path}/multilevel.yml"
end

before :all do
ENV_BACKUP = ENV.to_hash
end

after :all do
Config.use_env = false

ENV_BACKUP.each { |k, v| ENV[k] = v }
end

before :each do
Expand Down

0 comments on commit d25a628

Please sign in to comment.