debian-mirror-gitlab/spec/support/stub_env.rb
2017-08-17 22:00:37 +05:30

7 lines
222 B
Ruby

module StubENV
def stub_env(key, value)
allow(ENV).to receive(:[]).and_call_original unless @env_already_stubbed
@env_already_stubbed ||= true
allow(ENV).to receive(:[]).with(key).and_return(value)
end
end