gitlab-org--gitlab-foss/spec/support/stub_env.rb

8 lines
222 B
Ruby
Raw Normal View History

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