From d25a628a566244599d29a516c1e6c3d430d99449 Mon Sep 17 00:00:00 2001 From: vovanmozg Date: Sun, 31 Mar 2024 00:37:44 +0100 Subject: [PATCH] Add ENV recovery after clearing during test run It affects tests which execute `rails runner` --- spec/config_env_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/config_env_spec.rb b/spec/config_env_spec.rb index 65e7da8b..0477e142 100644 --- a/spec/config_env_spec.rb +++ b/spec/config_env_spec.rb @@ -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