<commit_before>require 'baseball_stats'
require 'fileutils'

BaseballStats::DataSource.name_key = "playerID,birthYear,nameFirst,nameLast"
BaseballStats::DataSource.name_key << "\naardsda01,1900,Player,One"
BaseballStats::DataSource.name_key << "\naardsda02,1900,Player,Two"
BaseballStats::DataSource.name_key << "\nallenbr01,1900,Player,Three"
BaseballStats::DataSource.name_key << "\nallenbr02,1900,Player,Four"
BaseballStats::DataSource.name_key << "\nnlplaye01,1900,NL Player,One"
BaseballStats::DataSource.name_key << "\nnlplaye02,1900,NL Player,Two"
BaseballStats::DataSource.name_key << "\nnlplaye03,1900,NL Player,Three"
BaseballStats::DataSource.name_key << "\nalplaye01,1900,AL Player,One"
BaseballStats::DataSource.name_key << "\nalplaye02,1900,AL Player,Two"
BaseballStats::DataSource.name_key << "\nalplaye03,1900,AL Player,Three"

ORIGINAL_STDOUT = $stdout

FileUtils.mkdir_p('tmp') unless File.directory?('tmp')
$stdout = File.open('./tmp/stdout.txt', 'w+')

at_exit do
  $stdout = ORIGINAL_STDOUT
end<commit_msg>Add RSpec explicitly to cucumber's world<commit_after>require 'baseball_stats'
require 'fileutils'
require 'rspec/expectations'

BaseballStats::DataSource.name_key = "playerID,birthYear,nameFirst,nameLast"
BaseballStats::DataSource.name_key << "\naardsda01,1900,Player,One"
BaseballStats::DataSource.name_key << "\naardsda02,1900,Player,Two"
BaseballStats::DataSource.name_key << "\nallenbr01,1900,Player,Three"
BaseballStats::DataSource.name_key << "\nallenbr02,1900,Player,Four"
BaseballStats::DataSource.name_key << "\nnlplaye01,1900,NL Player,One"
BaseballStats::DataSource.name_key << "\nnlplaye02,1900,NL Player,Two"
BaseballStats::DataSource.name_key << "\nnlplaye03,1900,NL Player,Three"
BaseballStats::DataSource.name_key << "\nalplaye01,1900,AL Player,One"
BaseballStats::DataSource.name_key << "\nalplaye02,1900,AL Player,Two"
BaseballStats::DataSource.name_key << "\nalplaye03,1900,AL Player,Three"

ORIGINAL_STDOUT = $stdout

FileUtils.mkdir_p('tmp') unless File.directory?('tmp')
$stdout = File.open('./tmp/stdout.txt', 'w+')

World(RSpec::Matchers)

at_exit do
  $stdout = ORIGINAL_STDOUT
end
{'fraction_non_alphanumeric': 0.14995313964386128, 'fraction_numerical': 0.056232427366447985, 'mean_word_length': 9.948717948717949, 'pattern_counts': {'":': 0, '<': 43, '<?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': '1424147', 'n_tokens_mistral': 828, 'n_tokens_neox': 739, 'n_words': 97}