<commit_before>require 'rspec/support/spec/in_sub_process'

describe 'isolating code to a sub process' do
  include RSpec::Support::InSubProcess

  it 'isolates the block from the main process' do
    in_sub_process do
      module NotIsolated
      end
      expect(defined? NotIsolated).to eq "constant"
    end
    expect(defined? NotIsolated).to be_nil
  end

  if Process.respond_to?(:fork) && !(RUBY_PLATFORM == 'java' && RUBY_VERSION == '1.8.7')

    it 'captures and reraises errors to the main process' do
      expect {
        in_sub_process { raise "An Internal Error" }
      }.to raise_error "An Internal Error"
    end

    it 'captures and reraises test failures' do
      expect {
        in_sub_process { expect(true).to be false }
      }.to raise_error(/expected #<FalseClass/)
    end

  else
<commit_msg>Fix failing spec.<commit_after>require 'rspec/support/spec/in_sub_process'

describe 'isolating code to a sub process' do
  include RSpec::Support::InSubProcess

  it 'isolates the block from the main process' do
    in_sub_process do
      module NotIsolated
      end
      expect(defined? NotIsolated).to eq "constant"
    end
    expect(defined? NotIsolated).to be_nil
  end

  if Process.respond_to?(:fork) && !(RUBY_PLATFORM == 'java' && RUBY_VERSION == '1.8.7')

    it 'captures and reraises errors to the main process' do
      expect {
        in_sub_process { raise "An Internal Error" }
      }.to raise_error "An Internal Error"
    end

    it 'captures and reraises test failures' do
      expect {
        in_sub_process { expect(true).to be false }
      }.to raise_error(/expected false/)
    end

  else

{'fraction_non_alphanumeric': 0.09035779260157671, 'fraction_numerical': 0.0036385688295936932, 'mean_word_length': 2.9855072463768115, 'pattern_counts': {'":': 0, '<': 4, '<?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': '1553436', 'n_tokens_mistral': 548, 'n_tokens_neox': 513, 'n_words': 162}