[ruby/open-uri] Use ENV.update

https://github.com/ruby/open-uri/commit/04067e54b9
This commit is contained in:
Nobuyoshi Nakada 2024-07-09 12:14:36 +09:00 committed by git
parent da8f554011
commit a355f7d351
2 changed files with 4 additions and 4 deletions

View File

@ -8,10 +8,10 @@ class TestOpenURIFtp < Test::Unit::TestCase
begin
old = {}
h.each_key {|k| old[k] = ENV[k] }
h.each {|k, v| ENV[k] = v }
ENV.update(h)
yield
ensure
h.each_key {|k| ENV[k] = old[k] }
ENV.update(old)
end
end

View File

@ -11,10 +11,10 @@ class TestOpenURIProxy < Test::Unit::TestCase
begin
old = {}
h.each_key {|k| old[k] = ENV[k] }
h.each {|k, v| ENV[k] = v }
ENV.update(h)
yield
ensure
h.each_key {|k| ENV[k] = old[k] }
ENV.update(old)
end
end