<commit_before># require 'codeclimate-test-reporter'
# CodeClimate::TestReporter.start
require 'coveralls'
Coveralls.wear!

$LOAD_PATH << File.expand_path('../../lib', __FILE__)

# require 'pry'
# require 'database_cleaner'
require 'mongoid'
require 'mongoid-rspec'

require 'mongoid/urls'

ENV['MONGOID_ENV'] = 'test'

Mongoid.configure do |config|
  config.load_configuration(
    clients: {
      default: {
        database: 'mongoid_urls_test',
        hosts: ["localhost: #{ENV['BOXEN_MONGODB_PORT'] || 27_017}"],
        options: {}
      }
    })
end

require 'support/models'

Mongo::Logger.logger.level = Logger::INFO

RSpec.configure do |config|
  config.include Mongoid::Matchers

  config.before(:each) do
    Mongoid.purge!
  end

  config.after(:suite) do
    puts "\n# With Mongoid v#{Mongoid::VERSION}"
  end
end<commit_msg>spec helper for mongoid 4 & 5<commit_after># require 'codeclimate-test-reporter'
# CodeClimate::TestReporter.start
if ENV['CI']
  require 'coveralls'
  Coveralls.wear!
end

$LOAD_PATH << File.expand_path('../../lib', __FILE__)

# require 'pry'
# require 'database_cleaner'
require 'mongoid'
require 'mongoid-rspec'

require 'mongoid/urls'

ENV['MONGOID_ENV'] = 'test'

db_config = {
  default: {
    database: 'mongoid_urls_test',
    hosts: ["localhost: #{ENV['BOXEN_MONGODB_PORT'] || 27_017}"],
    options: {}
  }
}

Mongoid.configure do |config|
  config.load_configuration(
    if Mongoid::VERSION >= '5'
      { clients: db_config }
    else
      { sessions: db_config }
    end
  )
end

require 'support/models'

Mongo::Logger.logger.level = Logger::INFO

RSpec.configure do |config|
  config.include Mongoid::Matchers

  config.before(:each) do
    Mongoid.purge!
  end

  config.after(:suite) do
    puts "\n# With Mongoid v#{Mongoid::VERSION}"
  end
end
{'fraction_non_alphanumeric': 0.14459833795013852, 'fraction_numerical': 0.007202216066481994, 'mean_word_length': 3.975206611570248, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 4, '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': '2442671', 'n_tokens_mistral': 655, 'n_tokens_neox': 648, 'n_words': 132}