Files
old-holivud2/spec/support/env_helper.rb

17 lines
363 B
Ruby
Raw Normal View History

2020-06-09 06:35:40 +02:00
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