mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
17 lines
265 B
Ruby
17 lines
265 B
Ruby
|
class TestConfigFileBase < Minitest::Test
|
||
|
private
|
||
|
|
||
|
def with_env(env = {})
|
||
|
original_env = {}
|
||
|
env.each do |k, v|
|
||
|
original_env[k] = ENV[k]
|
||
|
ENV[k] = v
|
||
|
end
|
||
|
yield
|
||
|
ensure
|
||
|
original_env.each do |k, v|
|
||
|
ENV[k] = v
|
||
|
end
|
||
|
end
|
||
|
end
|