Upstream sync master
This commit is contained in:
16
spec/support/env_helper.rb
Normal file
16
spec/support/env_helper.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
module EnvHelper
|
||||
def stub_env_variables(vars)
|
||||
allow(ENV).to receive(:[]).and_call_original
|
||||
vars.each do |variable, value|
|
||||
allow(ENV).to receive(:[]).with(variable.to_s).and_return(value)
|
||||
end
|
||||
end
|
||||
|
||||
def stub_env_variable(key, value)
|
||||
stub_env_variables({key => value})
|
||||
end
|
||||
end
|
||||
|
||||
RSpec.configure do |config|
|
||||
config.include EnvHelper
|
||||
end
|
||||
Reference in New Issue
Block a user