Sha256: 45627a2095152331cb99738d0ee94483f3971680b2068191ea05d16dedb705c1

Contents?: true

Size: 264 Bytes

Versions: 18

Compression:

Stored size: 264 Bytes

Contents

module EnvironmentSpecHelper
  def with_env(opts = {})
    old = {}
    opts.each do |k, v|
      k = k.to_s
      v = v.to_s unless v.nil?
      old[k] = ENV[k]
      ENV[k] = v
    end
    yield
  ensure
    old.each do |k, v|
      ENV[k] = v
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
journaled-4.3.0 spec/support/environment_spec_helper.rb
journaled-4.2.0 spec/support/environment_spec_helper.rb
journaled-4.1.0 spec/support/environment_spec_helper.rb
journaled-4.0.0 spec/support/environment_spec_helper.rb
journaled-3.1.0 spec/support/environment_spec_helper.rb
journaled-3.0.0 spec/support/environment_spec_helper.rb
journaled-2.5.0 spec/support/environment_spec_helper.rb
journaled-2.4.0 spec/support/environment_spec_helper.rb
journaled-2.3.1 spec/support/environment_spec_helper.rb
journaled-2.3.0 spec/support/environment_spec_helper.rb
journaled-2.2.0 spec/support/environment_spec_helper.rb
journaled-2.1.1 spec/support/environment_spec_helper.rb
journaled-2.1.0 spec/support/environment_spec_helper.rb
journaled-2.0.3 spec/support/environment_spec_helper.rb
journaled-2.0.2 spec/support/environment_spec_helper.rb
journaled-2.0.1 spec/support/environment_spec_helper.rb
journaled-2.0.0 spec/support/environment_spec_helper.rb
journaled-2.0.0.rc1 spec/support/environment_spec_helper.rb