# coding: utf-8 $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) require 'rspec' require 'simplecov' require 'mongoid' require 'database_cleaner' SimpleCov.start require 'russian_phone' # Requires supporting files with custom matchers and macros, etc, # in ./support/ and its subdirectories. Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} Mongoid.configure do |config| ENV["MONGOID_ENV"] = "test" Mongoid.load!("spec/support/mongoid.yml") end DatabaseCleaner.orm = "mongoid" RSpec.configure do |config| config.before(:all) do DatabaseCleaner.strategy = :truncation end config.before(:each) do DatabaseCleaner.start end config.after(:each) do DatabaseCleaner.clean end config.mock_with :rspec end