Skip to content

Commit

Permalink
Merge pull request #7662 from nobu/fix-with_env
Browse files Browse the repository at this point in the history
Do not override `@orig_env`
  • Loading branch information
hsbt committed May 15, 2024
2 parents 8a0c7e4 + 880c5de commit b1e483c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/rubygems/helper.rb
Expand Up @@ -535,12 +535,12 @@ def without_any_upwards_gemfiles
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

Expand Down

0 comments on commit b1e483c

Please sign in to comment.