Sha256: f8ee7a333af6fe402ae168d84ff74bc8f9b587cd68b2b0b4f9b81daa843112e1

Contents?: true

Size: 845 Bytes

Versions: 2

Compression:

Stored size: 845 Bytes

Contents

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))

MODELS = File.join(File.dirname(__FILE__), "models")
$LOAD_PATH.unshift(MODELS)

require "mongoid"
require "mongoid-eager-loading"
require "mocha"
require "rspec"

Mongoid.configure do |config|
  name = "mongoid_test"
  host = "localhost"
  #config.master = Mongo::Connection.new(host, 27018, :logger => Logger.new($stdout)).db(name)
  config.master = Mongo::Connection.new.db(name)
  # config.slaves = [
    # Mongo::Connection.new(host, 27018, :slave_ok => true).db(name)
  # ]
end

Dir[ File.join(MODELS, "*.rb") ].sort.each { |file| require File.basename(file) }

Rspec.configure do |config|
  config.mock_with :mocha
  config.after :suite do
    Mongoid.master.collections.select {|c| c.name !~ /system/ }.each(&:drop)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mongoid-eager-loading-0.3.1 spec/spec_helper.rb
mongoid-eager-loading-0.3.0 spec/spec_helper.rb