<commit_before>require 'rubygems'
require 'rails'
require 'active_record'


ENV["RAILS_ENV"] ||= 'test'
RSpec.configure do |config|

  require 'sqlite3'
  class SQLite3::Database
    def self.query_log
      @@query_log ||= []
    end

    alias_method :old_execute, :execute
    alias_method :old_prepare, :prepare

    def execute(*args,&blk)
      self.class.query_log << [args, caller, Thread.current.object_id]
      old_execute(*args,&blk)
    end

    def prepare(*args,&blk)
      self.class.query_log << [args, caller, Thread.current.object_id]
      old_prepare(*args,&blk)
    end

  end

  config.before(:suite) do
    ActiveRecord::Base.configurations["test"] = (YAML::load(File.open("spec/fixtures/database.yml"))['test'])
  end

end

<commit_msg>Run specs in random order.<commit_after>require 'rubygems'
require 'rails'
require 'active_record'

ENV["RAILS_ENV"] ||= 'test'
RSpec.configure do |config|
  config.order = 'random'

  require 'sqlite3'

  class SQLite3::Database
    def self.query_log
      @@query_log ||= []
    end

    alias_method :old_execute, :execute
    alias_method :old_prepare, :prepare

    def execute(*args,&blk)
      self.class.query_log << [args, caller, Thread.current.object_id]
      old_execute(*args,&blk)
    end

    def prepare(*args,&blk)
      self.class.query_log << [args, caller, Thread.current.object_id]
      old_prepare(*args,&blk)
    end

  end

  config.before(:suite) do
    ActiveRecord::Base.configurations["test"] = (YAML::load(File.open("spec/fixtures/database.yml"))['test'])
  end

end
{'fraction_non_alphanumeric': 0.14304041051956382, 'fraction_numerical': 0.0025657472738935213, 'mean_word_length': 3.8447204968944098, 'pattern_counts': {'":': 0, '<': 11, '<?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': '6496887', 'n_tokens_mistral': 545, 'n_tokens_neox': 521, 'n_words': 102}