Sha256: 5b8904570ad934dde68293f0dd17935368f81f6f2a1ed1115c41a0b445f4f0d8

Contents?: true

Size: 754 Bytes

Versions: 2

Compression:

Stored size: 754 Bytes

Contents

require 'rubygems'
require 'bundler'
Bundler.setup

require 'mongoid'
models_folder = File.join(File.dirname(__FILE__), 'mongoid/models')
Mongoid.configure do |config|
  name = 'voteable_mongo_test'
  host = 'localhost'
  config.connect_to(name)
end

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))

Mongoid.logger.level = Logger::ERROR
Mongo::Logger.logger.level = Logger::ERROR

require 'voteable_mongo'
require 'rspec'
require 'rspec/autorun'

Dir[ File.join(models_folder, '*.rb') ].each { |file|
  require file
  file_name = File.basename(file).sub('.rb', '')
  klass = file_name.classify.constantize
  begin
    klass.collection.drop
  rescue Exception => e
    print e.message
  end
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rs_voteable_mongo-1.3.0 spec/spec_helper.rb
rs_voteable_mongo-1.2.0 spec/spec_helper.rb