[ruby/open-uri] Use ENV.update
https://github.com/ruby/open-uri/commit/04067e54b9
This commit is contained in:
parent
da8f554011
commit
a355f7d351
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user