<commit_before>require 'adhearsion/component_manager/component_tester'
begin
  require 'rspec'
rescue LoadError
  abort "You do not have the 'rspec' gem installed! You must install it to continue.\n\nsudo gem install rspec\n\n"
end

module ComponentConfigurationSpecHelper
  def mock_component_config_with(new_config)
    Object.send(:remove_const, :COMPONENTS) rescue nil
    Object.send(:const_set, :COMPONENTS, OpenStruct.new(new_config))
  end
end

RSpec.configure do |config|
  config.mock_with :rspec
  config.include ComponentConfigurationSpecHelper
end<commit_msg>Mock ahn_log in component test framework<commit_after>require 'adhearsion/component_manager/component_tester'
begin
  require 'rspec'
rescue LoadError
  abort "You do not have the 'rspec' gem installed! You must install it to continue.\n\nsudo gem install rspec\n\n"
end

module ComponentConfigurationSpecHelper
  def mock_component_config_with(new_config)
    Object.send(:remove_const, :COMPONENTS) rescue nil
    Object.send(:const_set, :COMPONENTS, OpenStruct.new(new_config))
  end
end

RSpec.configure do |config|
  config.mock_with :rspec
  config.include ComponentConfigurationSpecHelper

  config.before { $mock_logger = mock.as_null_object }

  def ahn_log
    $mock_logger
  end
end
{'fraction_non_alphanumeric': 0.07351778656126483, 'fraction_numerical': 0.0, 'mean_word_length': 5.59375, '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': '4663560', 'n_tokens_mistral': 400, 'n_tokens_neox': 395, 'n_words': 105}