summaryrefslogtreecommitdiff
path: root/spec/ruby/core/env/replace_spec.rb
blob: 8837deea4aa4f6946036b88e0d6e40f8f1cd9f2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require_relative '../../spec_helper'

describe "ENV.replace" do

  it "replaces ENV with a Hash" do
    ENV["foo"] = "bar"
    e = ENV.reject { |k, v| k == "foo" }
    e["baz"] = "bam"
    ENV.replace e
    ENV["foo"].should == nil
    ENV["baz"].should == "bam"
    ENV.delete "baz"
  end

end