Sha256: 895f357069823f1a856b420b649af252add150d04cbcd1a3d294ca503c7dbc74
Contents?: true
Size: 1.14 KB
Versions: 19
Compression:
Stored size: 1.14 KB
Contents
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) require 'rspec' require 'mebla' require 'bundler' Bundler.require :default, :development require "#{File.dirname(__FILE__)}/mebla_helper" require "#{File.dirname(__FILE__)}/../lib/mebla" # Requires supporting files with custom matchers and macros, etc, # in ./support/ and its subdirectories. Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} RSpec.configure do |config| require 'database_cleaner' mebla = MeblaHelper.new mebla.setup_mongoid require "#{File.dirname(__FILE__)}/fixtures/models" config.before(:all) do %w(tmp tmp/config tmp/log).each do |path| FileUtils.mkdir_p "#{Dir.pwd}/#{path}" end end config.after(:all) do #FileUtils.rm_r "#{Dir.pwd}/tmp" rescue nil end config.before(:suite) do DatabaseCleaner.strategy = :truncation DatabaseCleaner.orm = "mongoid" end config.before(:each) do DatabaseCleaner.clean end config.before(:suite) do Mebla.context.create_index end config.after(:suite) do Mebla.context.drop_index end end
Version data entries
19 entries across 19 versions & 2 rubygems