<commit_before>require 'open3'

# Add the bin directory, to allow testing of gem executables as if the gem is
# already installed.
root_dir = RSpec::Core::RubyProject.root
exec_dir = root_dir.join('bin')
ENV['PATH'] = [exec_dir, ENV['PATH']].join(File::PATH_SEPARATOR)

# Courtesy of:
# https://raw.github.com/cupakromer/tao-of-tdd/master/adder/spec/support/
#    capture_exec.rb
def exec_io(*cmd)
  cmd = cmd.flatten
  out_err, _exit_code = Open3.capture2e(*cmd)

  out_err
end

RSpec.configure do |config|
  config.filter_run_excluding :wip
  config.run_all_when_everything_filtered = true
  config.order = 'random'
  config.alias_it_should_behave_like_to :has_behavior
  config.alias_it_should_behave_like_to :it_has_behavior, 'has behavior:'
end

def let_double(*doubles)
  doubles.each do |double_sym|
    let(double_sym) { double(double_sym.to_s) }
  end
end
<commit_msg>Fix Rspec version compatibility issue<commit_after>require 'open3'

# Add the bin directory, to allow testing of gem executables as if the gem is
# already installed.
root_dir = RSpec::Core::RubyProject.root
exec_dir = File.join(root_dir, 'bin')
ENV['PATH'] = [exec_dir, ENV['PATH']].join(File::PATH_SEPARATOR)

# Courtesy of:
# https://raw.github.com/cupakromer/tao-of-tdd/master/adder/spec/support/
#    capture_exec.rb
def exec_io(*cmd)
  cmd = cmd.flatten
  out_err, _exit_code = Open3.capture2e(*cmd)

  out_err
end

RSpec.configure do |config|
  config.filter_run_excluding :wip
  config.run_all_when_everything_filtered = true
  config.order = 'random'
  config.alias_it_should_behave_like_to :has_behavior
  config.alias_it_should_behave_like_to :it_has_behavior, 'has behavior:'
end

def let_double(*doubles)
  doubles.each do |double_sym|
    let(double_sym) { double(double_sym.to_s) }
  end
end

{'fraction_non_alphanumeric': 0.11266816143497758, 'fraction_numerical': 0.0033632286995515697, 'mean_word_length': 5.329787234042553, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '6782454', 'n_tokens_mistral': 679, 'n_tokens_neox': 658, 'n_words': 133}