2010-06-08 00:45:49 +00:00
|
|
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
|
|
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
|
|
|
|
|
2010-06-30 13:18:17 +00:00
|
|
|
MODELS = File.join(File.dirname(__FILE__), 'models')
|
2010-06-08 00:45:49 +00:00
|
|
|
$LOAD_PATH.unshift(MODELS)
|
|
|
|
|
|
|
|
require 'rubygems'
|
|
|
|
require 'bundler'
|
|
|
|
Bundler.setup
|
|
|
|
Bundler.require
|
|
|
|
|
|
|
|
require 'mongoid'
|
|
|
|
require 'mocha'
|
|
|
|
require 'rspec'
|
|
|
|
require 'custom_fields'
|
|
|
|
|
|
|
|
Dir[ File.join(MODELS, "*.rb") ].sort.each { |file| require File.basename(file) }
|
|
|
|
|
2010-06-30 13:18:17 +00:00
|
|
|
require 'support/mongoid'
|
|
|
|
require 'support/carrierwave'
|
2010-06-08 00:45:49 +00:00
|
|
|
|
|
|
|
Rspec.configure do |config|
|
|
|
|
config.mock_with :mocha
|
|
|
|
config.after :suite do
|
2010-06-30 00:03:34 +00:00
|
|
|
Mongoid.master.collections.select { |c| c.name != 'system.indexes' }.each(&:drop)
|
2010-06-08 00:45:49 +00:00
|
|
|
end
|
|
|
|
end
|