Module: ErgomentumRspec::Helpers::Environment

Defined in:
lib/ergomentum_rspec/helpers/environment.rb

Instance Method Summary collapse

Instance Method Details

#mock_environment_variables(env_hash) ⇒ Object



6
7
8
9
10
11
# 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