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-6.0.24 spec/support/env_helpers.rb
omnibus-6.0.1 spec/support/env_helpers.rb
omnibus-5.6.8 spec/support/env_helpers.rb
omnibus-5.6.6 spec/support/env_helpers.rb
omnibus-5.6.1 spec/support/env_helpers.rb
omnibus-5.6.0 spec/support/env_helpers.rb
omnibus-5.5.0 spec/support/env_helpers.rb
omnibus-5.4.0 spec/support/env_helpers.rb
omnibus-5.3.0 spec/support/env_helpers.rb
omnibus-5.2.0 spec/support/env_helpers.rb
omnibus-5.1.0 spec/support/env_helpers.rb
omnibus-5.0.0 spec/support/env_helpers.rb
omnibus-4.1.0 spec/support/env_helpers.rb
omnibus-4.0.0 spec/support/env_helpers.rb
omnibus-4.0.0.rc.2 spec/support/env_helpers.rb
omnibus-4.0.0.rc.1 spec/support/env_helpers.rb
omnibus-4.0.0.beta.1 spec/support/env_helpers.rb