<commit_before>describe :env_update, shared: true do
  before :each do
    @saved_foo = ENV["foo"]
    @saved_bar = ENV["bar"]
  end

  after :each do
    ENV["foo"] = @saved_foo
    ENV["bar"] = @saved_bar
  end

  it "adds the parameter hash to ENV, returning ENV" do
    ENV.send(@method, "foo" => "0", "bar" => "1").should equal(ENV)
    ENV["foo"].should == "0"
    ENV["bar"].should == "1"
  end

  it "returns ENV when no block given" do
    ENV.send(@method, {"foo" => "0", "bar" => "1"}).should equal(ENV)
  end

  it "yields key, the old value and the new value when replacing an entry" do
    ENV.send @method, {"foo" => "0", "bar" => "3"}
    a = []
    ENV.send @method, {"foo" => "1", "bar" => "4"} do |key, old, new|
      a << [key, old, new]
      new
    end
    a[0].should == ["foo", "0", "1"]
    a[1].should == ["bar", "3", "4"]
  end

  it "yields key, the old value and the new value when replacing an entry" do
    ENV.send @method, {"foo" => "0", "bar" => "3"}<commit_msg>ENV.merge! support multile arguments [Feature #18279]<commit_after>describe :env_update, shared: true do
  before :each do
    @saved_foo = ENV["foo"]
    @saved_bar = ENV["bar"]
  end

  after :each do
    ENV["foo"] = @saved_foo
    ENV["bar"] = @saved_bar
  end

  it "adds the parameter hash to ENV, returning ENV" do
    ENV.send(@method, "foo" => "0", "bar" => "1").should equal(ENV)
    ENV["foo"].should == "0"
    ENV["bar"].should == "1"
  end

  ruby_version_is "3.1" do
    it "adds the multiple parameter hashes to ENV, returning ENV" do
      ENV.send(@method, {"foo" => "0", "bar" => "1"}, {"baz" => "2"}).should equal(ENV)
      ENV["foo"].should == "0"
      ENV["bar"].should == "1"
      ENV["baz"].should == "2"
    end
  end

  it "returns ENV when no block given" do
    ENV.send(@method, {"foo" => "0", "bar" => "1"}).should equal(ENV)
  end

  it "yields key, the old value and the new value when replacing an entry" do
    ENV.send @method, {"foo" => "0", "bar" => "3"}
    a = []
    ENV.send @method, {"foo" => "1", "bar" => "4"} do |key, old, new|
      a << [key, old, new]
      new
    end
    a[0].should == ["foo", "0", "1"]
    a[1].should == ["bar", "3", "4"]
  end

  it "yields key, the old value and the new value when replacing an entry" do
    ENV.send @method, {"foo" => "0", "bar" => "3"}
{'fraction_non_alphanumeric': 0.2036082474226804, 'fraction_numerical': 0.02104810996563574, 'mean_word_length': 2.9077181208053693, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 26, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3795861', 'n_tokens_mistral': 907, 'n_tokens_neox': 858, 'n_words': 284}