<commit_before>COOKBOOK_RESOLVERS = {
  'batali' => ['Batali', 'batali/chefspec'],
  'berkshelf' => ['Berksfile', 'chefspec/berkshelf'],
  'librarian' => ['Cheffile', 'chefspec/librarian']
}

require 'chefspec'

if(ENV['COOKBOOK_RESOLVER'])
  require COOKBOOK_RESOLVERS[ENV['COOKBOOK_RESOLVER']]
else
  resolver_lib = COOKBOOK_RESOLVERS.values.detect do |r_file, r_lib|
    File.exists?(File.join(File.dirname(__FILE__), '..', r_file))
  end
  raise "Failed to locate valid cookbook resolver files!" unless resolver_lib
  puts "Resolving cookbooks from #{resolver_lib.first}"
  require resolver_lib.last
end

at_exit { ChefSpec::Coverage.report! }<commit_msg>adjust spec_helper to satisfy rubocop<commit_after>COOKBOOK_RESOLVERS = {
  'batali' => ['Batali', 'batali/chefspec'],
  'berkshelf' => ['Berksfile', 'chefspec/berkshelf'],
  'librarian' => ['Cheffile', 'chefspec/librarian']
}

require 'chefspec'

if ENV['COOKBOOK_RESOLVER']
  require COOKBOOK_RESOLVERS[ENV['COOKBOOK_RESOLVER']]
else
  resolver_lib = COOKBOOK_RESOLVERS.values.detect do |r_file, _r_lib|
    File.exist?(File.join(File.dirname(__FILE__), '..', r_file))
  end
  fail 'Failed to locate valid cookbook resolver files!' unless resolver_lib
  puts "Resolving cookbooks from #{resolver_lib.first}"
  require resolver_lib.last
end

at_exit { ChefSpec::Coverage.report! }
{'fraction_non_alphanumeric': 0.1417910447761194, 'fraction_numerical': 0.0, 'mean_word_length': 6.132978723404255, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5653118', 'n_tokens_mistral': 530, 'n_tokens_neox': 519, 'n_words': 93}