Module: RspecHelpers::Stubs

Defined in:
foobara-spec-helpers-0.0.4/lib/foobara/spec_helpers/stubs.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#stub_env_var(env_var, value) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'foobara-spec-helpers-0.0.4/lib/foobara/spec_helpers/stubs.rb', line 23

def stub_env_var(env_var, value)
  env_var = env_var.to_s

  unless self.class.[:env_stubbed]
    install_env_stubs
  end

  self.class.[:env_stubbed][env_var] = value
end

#stub_env_vars(env_vars) ⇒ Object



17
18
19
20
21
# File 'foobara-spec-helpers-0.0.4/lib/foobara/spec_helpers/stubs.rb', line 17

def stub_env_vars(env_vars)
  env_vars.each_pair do |env_var, value|
    stub_env_var(env_var, value)
  end
end