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-4.0.0 spec/support/env_helper.rb
knapsack-3.1.0 spec/support/env_helper.rb
knapsack-3.0.0 spec/support/env_helper.rb
knapsack-2.0.0 spec/support/env_helper.rb
knapsack-1.22.0 spec/support/env_helper.rb
knapsack-1.21.1 spec/support/env_helper.rb
knapsack-1.21.0 spec/support/env_helper.rb
knapsack-1.20.0 spec/support/env_helper.rb
knapsack-1.19.0 spec/support/env_helper.rb
knapsack-1.18.0 spec/support/env_helper.rb
knapsack-1.17.2 spec/support/env_helper.rb
knapsack-1.17.1 spec/support/env_helper.rb
knapsack-1.17.0 spec/support/env_helper.rb
knapsack-1.16.0 spec/support/env_helper.rb
knapsack-1.15.0 spec/support/env_helper.rb
knapsack-1.14.1 spec/support/env_helper.rb
knapsack-1.14.0 spec/support/env_helper.rb
knapsack-1.13.3 spec/support/env_helper.rb
knapsack-1.13.2 spec/support/env_helper.rb
knapsack-1.13.1 spec/support/env_helper.rb