Sha256: 4ae65202aa0fee53f82a2e5b44d677121968863a082f965551c1ffe0a48bb5f9

Contents?: true

Size: 947 Bytes

Versions: 1

Compression:

Stored size: 947 Bytes

Contents

# 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/tenant'

ENV['MONGOID_ENV'] = 'test'

db_config = {
  default: {
    database: 'mongoid_tenant_test',
    hosts: ["localhost: #{ENV['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 if Mongoid::VERSION >= '5'

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mongoid-tenant-0.0.5 spec/spec_helper.rb