Sha256: f27062f850b5b7a4ebfa4a74cf464441becc037c86fb52ad67f35150a2dec62a

Contents?: true

Size: 735 Bytes

Versions: 1

Compression:

Stored size: 735 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 'rubygems'

gem "mocha", ">= 0.9.8"

require "mocha"
require "mongoid"
require "spec"

Mongoid.configure do |config|
  name = "mongoid_test"
  host = "localhost"
  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) }

Spec::Runner.configure do |config|
  config.mock_with :mocha
  config.after :suite do
    Mongoid.master.collections.each(&:drop)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mongoid-pre-2.0.0.pre spec/spec_helper.rb