Module: RSpec::StubbedEnv::HideHelpers — Documentation by YARD 0.9.37

# Module: RSpec::StubbedEnv::HideHelpers

Includes:
  StubHelpers

Defined in:
  lib/rspec/stubbed_env/hide_helpers.rb

## Overview

Helpers to unobtrusively stub ENV

## Instance Method Summary collapse

- #hide_env(*keys) ⇒ Object

  Can be called with an array of ENV keys to hide:.

### Methods included from StubHelpers

#stub_env

## Instance Method Details

### #hide_env(*keys) ⇒ `Object`

Can be called with an array of ENV keys to hide:

    hide_env('FOO', 'BAR', 'BAZ') # Preferred

Alternatively can be called once per ENV key to hide:

    stub_env('A') # NOT
    stub_env('C') # AS
    stub_env('E') # GOOD (creates redundant stubs on values_at)

    39
    40
    41
    42
    43
    44
    # File 'lib/rspec/stubbed_env/hide_helpers.rb', line 39

    def hide_env(*keys)
      init_stub unless env_stubbed?
      keys.each do |key|
        add_hidden_key(key)
      end
    end