Skip to content

Commit

Permalink
[ruby/open-uri] Use ENV.update
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu authored and matzbot committed Nov 25, 2024
1 parent da8f554 commit a355f7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/open-uri/test_ftp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ def with_env(h)
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

Expand Down
4 changes: 2 additions & 2 deletions test/open-uri/test_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ def with_env(h)
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

Expand Down

0 comments on commit a355f7d

Please sign in to comment.