module ErgomentumRspec::Helpers::Environment

Public Instance Methods

mock_environment_variables(env_hash) click to toggle source
# File lib/ergomentum_rspec/helpers/environment.rb, line 6
def mock_environment_variables(env_hash)
  # Using stub_const("ENV", ENV.to_h.merge(env_hash)) as simple solution does not work when using cuprite
  # in feature specs. Something seems to rely on the concrete implementation of ENV.
  # When we stub the const ENV with a Hash in such feature specs the whole ruby environment crashes.
  EnvVarMockService.instance.mock_environment_variables(env_hash)
end