mirror of
https://github.com/ruby/ruby.git
synced 2025-08-27 23:16:42 +02:00
[rubygems/rubygems] Do not override @orig_env
It is saved in `setup` and restored in `teardown`.
880c5de667
This commit is contained in:
parent
e3e1e53098
commit
e73f6618d5
1 changed files with 2 additions and 2 deletions
|
@ -535,12 +535,12 @@ class Gem::TestCase < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def with_env(overrides, &block)
|
def with_env(overrides, &block)
|
||||||
@orig_env = ENV.to_h
|
orig_env = ENV.to_h
|
||||||
ENV.replace(overrides)
|
ENV.replace(overrides)
|
||||||
begin
|
begin
|
||||||
block.call
|
block.call
|
||||||
ensure
|
ensure
|
||||||
ENV.replace(@orig_env)
|
ENV.replace(orig_env)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue