<commit_before>require File.expand_path('../../../spec_helper', __FILE__)

ruby_version_is "2.4" do
  describe "Thread.report_on_exception" do
    it "defaults to false" do
      ruby_exe("p Thread.report_on_exception").should == "false\n"
    end
  end

  describe "Thread.report_on_exception=" do
    before :each do
      @report_on_exception = Thread.report_on_exception
    end

    after :each do
      Thread.report_on_exception = @report_on_exception
    end

    it "changes the default value for new threads" do
      Thread.report_on_exception = true
      Thread.report_on_exception.should == true
      t = Thread.new {}
      t.join
      t.report_on_exception.should == true
    end
  end

  describe "Thread#report_on_exception" do
    it "returns whether the Thread will print a backtrace if it exits with an exception" do<commit_msg>Set Thread.report_on_exception=true by default to report exceptions in Threads<commit_after>require File.expand_path('../../../spec_helper', __FILE__)

ruby_version_is "2.4" do
  describe "Thread.report_on_exception" do
    ruby_version_is "2.4"..."2.5" do
      it "defaults to false" do
        ruby_exe("p Thread.report_on_exception").should == "false\n"
      end
    end

    ruby_version_is "2.5" do
      it "defaults to true" do
        ruby_exe("p Thread.report_on_exception").should == "true\n"
      end
    end
  end

  describe "Thread.report_on_exception=" do
    before :each do
      @report_on_exception = Thread.report_on_exception
    end

    after :each do
      Thread.report_on_exception = @report_on_exception
    end

    it "changes the default value for new threads" do
      Thread.report_on_exception = true
      Thread.report_on_exception.should == true
      t = Thread.new {}
      t.join
      t.report_on_exception.should == true
    end
  end

  describe "Thread#report_on_exception" do
    it "returns whether the Thread will print a backtrace if it exits with an exception" do
{'fraction_non_alphanumeric': 0.08600508905852418, 'fraction_numerical': 0.005089058524173028, 'mean_word_length': 3.028688524590164, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1353557', 'n_tokens_mistral': 616, 'n_tokens_neox': 594, 'n_words': 170}