Sha256: 249bdd927cdefd2415ece3c84a29ed3a31d401ac6506c727b4437a50a5fbdad6

Contents?: true

Size: 451 Bytes

Versions: 37

Compression:

Stored size: 451 Bytes

Contents

module Omnibus
  module RSpec
    module EnvHelpers
      #
      # Stub the given environment key.
      #
      # @param [String] key
      # @param [String] value
      #
      def stub_env(key, value)
        unless @__env_already_stubbed__
          allow(ENV).to receive(:[]).and_call_original
          @__env_already_stubbed__ = true
        end

        allow(ENV).to receive(:[]).with(key).and_return(value.to_s)
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
omnibus-9.0.24 spec/support/env_helpers.rb
omnibus-9.0.23 spec/support/env_helpers.rb
omnibus-9.0.22 spec/support/env_helpers.rb
omnibus-9.0.17 spec/support/env_helpers.rb
omnibus-9.0.12 spec/support/env_helpers.rb
omnibus-9.0.11 spec/support/env_helpers.rb
omnibus-9.0.8 spec/support/env_helpers.rb
omnibus-8.3.2 spec/support/env_helpers.rb
omnibus-8.2.2 spec/support/env_helpers.rb
omnibus-8.1.15 spec/support/env_helpers.rb
omnibus-8.0.15 spec/support/env_helpers.rb
omnibus-8.0.9 spec/support/env_helpers.rb
omnibus-7.0.34 spec/support/env_helpers.rb
omnibus-7.0.13 spec/support/env_helpers.rb
omnibus-7.0.12 spec/support/env_helpers.rb
omnibus-6.1.9 spec/support/env_helpers.rb
omnibus-6.1.7 spec/support/env_helpers.rb
omnibus-6.1.4 spec/support/env_helpers.rb
omnibus-6.0.30 spec/support/env_helpers.rb
omnibus-6.0.25 spec/support/env_helpers.rb