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

Version Path
rmla-1.0 spec/spec_helper.rb
mebla-1.1.14 spec/spec_helper.rb
mebla-1.1.13 spec/spec_helper.rb
mebla-1.1.12 spec/spec_helper.rb
mebla-1.1.11 spec/spec_helper.rb
mebla-1.1.10 spec/spec_helper.rb
mebla-1.1.9 spec/spec_helper.rb
mebla-1.1.8 spec/spec_helper.rb
mebla-1.1.7 spec/spec_helper.rb
mebla-1.1.6 spec/spec_helper.rb
mebla-1.1.5 spec/spec_helper.rb
mebla-1.1.4 spec/spec_helper.rb
mebla-1.1.2 spec/spec_helper.rb
mebla-1.1.1 spec/spec_helper.rb
mebla-1.1.0 spec/spec_helper.rb
mebla-1.0.3 spec/spec_helper.rb
mebla-1.0.2 spec/spec_helper.rb
mebla-1.0.1 spec/spec_helper.rb
mebla-1.0.0 spec/spec_helper.rb