<commit_before>require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:rspec) do |t|
  t.pattern = 'spec/lib/**/*_spec.rb'
end

if ENV.key?('RUBYSPEC')
  warn "Did you mean RUBYSPECS=...? (RUBYSPEC was found among ENV variables)"
  exit 1
end

module Testing
  extend self

  def get_random_seed(env)
    random_seed = env['RANDOM_SEED'] ? env['RANDOM_SEED'] : rand(100_000)
    puts "export RANDOM_SEED=#{random_seed} # to re-use the same randomization"
    random_seed
  end

  module MSpec
    extend self

    def stubs
      %w[
        mspec/helpers/tmp
        mspec/helpers/environment
        mspec/guards/block_device
        a_file
        lib/spec_helper
        mspec/commands/mspec-run
        etc
      ]
    end

    def specs(env = ENV)<commit_msg>Stub rubygems while running mspec<commit_after>require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:rspec) do |t|
  t.pattern = 'spec/lib/**/*_spec.rb'
end

if ENV.key?('RUBYSPEC')
  warn "Did you mean RUBYSPECS=...? (RUBYSPEC was found among ENV variables)"
  exit 1
end

module Testing
  extend self

  def get_random_seed(env)
    random_seed = env['RANDOM_SEED'] ? env['RANDOM_SEED'] : rand(100_000)
    puts "export RANDOM_SEED=#{random_seed} # to re-use the same randomization"
    random_seed
  end

  module MSpec
    extend self

    def stubs
      %w[
        mspec/helpers/tmp
        mspec/helpers/environment
        mspec/guards/block_device
        a_file
        lib/spec_helper
        mspec/commands/mspec-run
        etc
        rubygems
      ]
    end

    def specs(env = ENV)
{'fraction_non_alphanumeric': 0.10439210693825589, 'fraction_numerical': 0.008911521323997454, 'mean_word_length': 2.6728971962616823, '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': '4075587', 'n_tokens_mistral': 591, 'n_tokens_neox': 570, 'n_words': 128}