[rubygems/rubygems] Do not override @orig_env

It is saved in `setup` and restored in `teardown`.

880c5de667
This commit is contained in:
Nobuyoshi Nakada 2024-05-15 16:53:27 +09:00 committed by git
parent e3e1e53098
commit e73f6618d5

View file

@ -535,12 +535,12 @@ class Gem::TestCase < Test::Unit::TestCase
end
def with_env(overrides, &block)
@orig_env = ENV.to_h
orig_env = ENV.to_h
ENV.replace(overrides)
begin
block.call
ensure
ENV.replace(@orig_env)
ENV.replace(orig_env)
end
end