Sha256: 68692f0d693dde733d697d7eafcaf4b2e45a8f78c362fe71767a12edbade4f9d
Contents?: true
Size: 900 Bytes
Versions: 2
Compression:
Stored size: 900 Bytes
Contents
require 'rubygems' require 'bundler' Bundler.setup if rand > 0.6 puts 'Mongoid' require 'mongoid' models_folder = File.join(File.dirname(__FILE__), 'mongoid/models') Mongoid.configure do |config| name = 'voteable_mongo_test' host = 'localhost' config.master = Mongo::Connection.new.db(name) config.autocreate_indexes = true end else puts 'MongoMapper' require 'mongo_mapper' models_folder = File.join(File.dirname(__FILE__), 'mongo_mapper/models') MongoMapper.database = 'voteable_mongo_test' end $LOAD_PATH.unshift(File.dirname(__FILE__)) $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) 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 # klass.collection.drop }
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
voteable_mongo-0.9.1 | spec/spec_helper.rb |
voteable_mongo-0.9.0 | spec/spec_helper.rb |