Sha256: 0155409748785edd664fe5d189db3c2f3a3190974aa35babc515fd6856f0a1bf

Contents?: true

Size: 583 Bytes

Versions: 3

Compression:

Stored size: 583 Bytes

Contents

# frozen_string_literal: true
require 'rspec'
require 'database_cleaner'
require 'mongoload'

# initialize model definitions
ENV['MONGOID_ENV'] = 'test'
Mongoid.load!(File.join(File.dirname(__FILE__), 'db', 'mongoid.yml'))
require_relative 'db/models'
Mongo::Logger.logger = Logger.new('log/test.log')

RSpec.configure do |config|
  config.order = 'random'

  config.before(:suite) do
    DatabaseCleaner.strategy = :truncation
    DatabaseCleaner.clean_with(:truncation)
  end

  config.around(:each) do |example|
    DatabaseCleaner.cleaning do
      example.run
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mongoload-0.0.3 spec/spec_helper.rb
mongoload-0.0.2 spec/spec_helper.rb
mongoload-0.0.1 spec/spec_helper.rb