<commit_before>describe :process_exit, shared: true do
  it "raises a SystemExit with status 0" do
    -> { @object.exit }.should raise_error(SystemExit) { |e|
      e.status.should == 0
    }
  end

  it "raises a SystemExit with the specified status" do
    [-2**16, -2**8, -8, -1, 0, 1 , 8, 2**8, 2**16].each do |value|
      -> { @object.exit(value) }.should raise_error(SystemExit) { |e|
        e.status.should == value
      }
    end
  end

  it "raises a SystemExit with the specified boolean status" do
    { true => 0, false => 1 }.each do |value, status|
      -> { @object.exit(value) }.should raise_error(SystemExit) { |e|
        e.status.should == status
      }
    end
  end

  it "tries to convert the passed argument to an Integer using #to_int" do
    obj = mock('5')
    obj.should_receive(:to_int).and_return(5)
    -> { @object.exit(obj) }.should raise_error(SystemExit) { |e|
      e.status.should == 5
    }
  end

  it "converts the passed Float argument to an Integer" do
    { -2.2 => -2, -0.1 => 0, 5.5 => 5, 827.999 => 827 }.each do |value, status|
      -> { @object.exit(value) }.should raise_error(SystemExit) { |e|
        e.status.should == status
      }
    end
  end

  it "raises TypeError if can't convert the argument to an Integer" do
    -> { @object.exit(Object.new) }.should raise_error(TypeError)
    -> { @object.exit('0') }.should raise_error(TypeError)
    -> { @object.exit([0]) }.should raise_error(TypeError)
    -> { @object.exit(nil) }.should raise_error(TypeError)
  end
<commit_msg>Process.exit should use "exit" for the message<commit_after>describe :process_exit, shared: true do
  it "raises a SystemExit with status 0" do
    -> { @object.exit }.should raise_error(SystemExit) { |e|
      e.status.should == 0
    }
  end

  it "raises a SystemExit with the specified status" do
    [-2**16, -2**8, -8, -1, 0, 1 , 8, 2**8, 2**16].each do |value|
      -> { @object.exit(value) }.should raise_error(SystemExit) { |e|
        e.status.should == value
      }
    end
  end

  it "raises a SystemExit with the specified boolean status" do
    { true => 0, false => 1 }.each do |value, status|
      -> { @object.exit(value) }.should raise_error(SystemExit) { |e|
        e.status.should == status
      }
    end
  end

  it "raises a SystemExit with message 'exit'" do
    -> { @object.exit }.should raise_error(SystemExit) { |e|
      e.message.should == "exit"
    }
  end

  it "tries to convert the passed argument to an Integer using #to_int" do
    obj = mock('5')
    obj.should_receive(:to_int).and_return(5)
    -> { @object.exit(obj) }.should raise_error(SystemExit) { |e|
      e.status.should == 5
    }
  end

  it "converts the passed Float argument to an Integer" do
    { -2.2 => -2, -0.1 => 0, 5.5 => 5, 827.999 => 827 }.each do |value, status|
      -> { @object.exit(value) }.should raise_error(SystemExit) { |e|
        e.status.should == status
      }
    end
  end

  it "raises TypeError if can't convert the argument to an Integer" do
    -> { @object.exit(Object.new) }.should raise_error(TypeError)
    -> { @object.exit('0') }.should raise_error(TypeError)
    -> { @object.exit([0]) }.should raise_error(TypeError)
    -> { @object.exit(nil) }.should raise_error(TypeError)
  end

{'fraction_non_alphanumeric': 0.1511627906976744, 'fraction_numerical': 0.025703794369645042, 'mean_word_length': 2.7147727272727273, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 34, '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': '7354400', 'n_tokens_mistral': 1196, 'n_tokens_neox': 1136, 'n_words': 325}