<commit_before>require 'rspec/support/spec/stderr_splitter'
require 'tempfile'

describe 'RSpec::Support::StdErrSplitter' do

  let(:splitter) { RSpec::Support::StdErrSplitter.new stderr }
  let(:stderr)   { STDERR }

  before do
    allow(stderr).to receive(:write)
  end

  around do |example|
    original = $stderr
    $stderr = splitter

    example.run

    $stderr = original
  end

  it 'conforms to the stderr interface' do
    stderr_methods = stderr.methods
<commit_msg>This spec has been intermittently failing on ruby 2.2 due to `birth time`.<commit_after>require 'rspec/support/spec/stderr_splitter'
require 'tempfile'

describe 'RSpec::Support::StdErrSplitter' do

  let(:splitter) { RSpec::Support::StdErrSplitter.new stderr }
  let(:stderr)   { STDERR }

  before do
    allow(stderr).to receive(:write)
  end

  around do |example|
    original = $stderr
    $stderr = splitter

    example.run

    $stderr = original
  end

  it 'conforms to the stderr interface' do
    stderr_methods = stderr.methods

    # On 2.2, there's a weird issue where stderr sometimes responds to `birthtime` and sometimes doesn't...
    stderr_methods -= [:birthtime] if RUBY_VERSION =~ /^2\.2/

{'fraction_non_alphanumeric': 0.10552763819095477, 'fraction_numerical': 0.005025125628140704, 'mean_word_length': 3.704724409448819, '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': '2972271', 'n_tokens_mistral': 406, 'n_tokens_neox': 379, 'n_words': 106}