Sha256: 3faf37f08ca49395a23963bb1bbb1c904e68cc53015ebbbab762451feb567d08

Contents?: true

Size: 219 Bytes

Versions: 39

Compression:

Stored size: 219 Bytes

Contents

module EnvHelper
  def with_env(vars)
    original = ENV.to_hash
    vars.each { |k, v| ENV[k] = v }

    begin
      yield
    ensure
      ENV.replace(original)
    end
  end
end
RSpec.configuration.include EnvHelper

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
knapsack-1.13.0 spec/support/env_helper.rb
knapsack-1.12.2 spec/support/env_helper.rb
knapsack-1.12.1 spec/support/env_helper.rb
knapsack-1.12.0 spec/support/env_helper.rb
knapsack-1.11.1 spec/support/env_helper.rb
knapsack-1.11.0 spec/support/env_helper.rb
knapsack-1.10.0 spec/support/env_helper.rb
knapsack-1.9.0 spec/support/env_helper.rb
knapsack-1.8.0 spec/support/env_helper.rb
knapsack-1.7.0 spec/support/env_helper.rb
knapsack-1.6.1 spec/support/env_helper.rb
knapsack-1.6.0 spec/support/env_helper.rb
knapsack-1.5.1 spec/support/env_helper.rb
knapsack-1.5.0 spec/support/env_helper.rb
knapsack-1.4.1 spec/support/env_helper.rb
knapsack-1.4.0 spec/support/env_helper.rb
knapsack-1.3.4 spec/support/env_helper.rb
knapsack-1.3.3 spec/support/env_helper.rb
knapsack-1.3.1 spec/support/env_helper.rb