<commit_before>$: << File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))

require 'rspec'
require 'active_record/connection_adapters/mysql_master_slave_adapter'

ActiveRecord::Base.logger =
  Logger.new($stdout).tap { |l| l.level = Logger::DEBUG }

module ActiveRecord
  class Base
    cattr_accessor :master_mock, :slave_mock
    def self.mysql_connection(config)
      config[:database] == 'slave' ? slave_mock : master_mock
    end
  end
end

describe ActiveRecord::ConnectionAdapters::MysqlMasterSlaveAdapter do
  let(:default_database_setup) do
    {<commit_msg>Require logger lib in all cases<commit_after>$: << File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))

require 'rspec'
require 'logger'
require 'active_record/connection_adapters/mysql_master_slave_adapter'

ActiveRecord::Base.logger =
  Logger.new($stdout).tap { |l| l.level = Logger::DEBUG }

module ActiveRecord
  class Base
    cattr_accessor :master_mock, :slave_mock
    def self.mysql_connection(config)
      config[:database] == 'slave' ? slave_mock : master_mock
    end
  end
end

describe ActiveRecord::ConnectionAdapters::MysqlMasterSlaveAdapter do
  let(:default_database_setup) do
    {
{'fraction_non_alphanumeric': 0.11882845188284519, 'fraction_numerical': 0.0, 'mean_word_length': 5.5, 'pattern_counts': {'":': 0, '<': 7, '<?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': '6632537', 'n_tokens_mistral': 387, 'n_tokens_neox': 378, 'n_words': 73}