spec/spec_helper.rb in mongoid_geospatial-2.0.0 vs spec/spec_helper.rb in mongoid_geospatial-2.2.0
- old
+ new
@@ -6,11 +6,11 @@
SUPPORT = File.join(File.dirname(__FILE__), "support")
$LOAD_PATH.unshift(MODELS)
$LOAD_PATH.unshift(SUPPORT)
require "mongoid"
-require "mocha"
+# require "mocha"
require "rspec"
require "mongoid_geospatial"
# These environment variables can be set if wanting to test against a database
# that is not on the local machine.
@@ -25,16 +25,14 @@
if RUBY_VERSION >= '1.9.2'
YAML::ENGINE.yamler = 'syck'
end
-puts "version: #{Mongoid::VERSION}"
+puts "Running with Mongoid v#{Mongoid::VERSION}"
-require 'mongoid_setup'
-
Mongoid.configure do |config|
- Mongoid::VersionSetup.configure config
+ config.connect_to('mongoid_geo_test')
end
# Autoload every model for the test suite that sits in spec/app/models.
Dir[ File.join(MODELS, "*.rb") ].sort.each do |file|
name = File.basename(file, ".rb")
@@ -42,29 +40,15 @@
end
Dir[ File.join(SUPPORT, "*.rb") ].each { |file| require File.basename(file) }
def bson_object_id_class
- Mongoid::VERSION > '3' ? Moped::BSON:: ObjectId : BSON::ObjectId
+ Moped::BSON::ObjectId
end
RSpec.configure do |config|
- config.mock_with(:mocha)
+ # config.mock_with(:mocha)
config.before(:each) do
Mongoid.purge!
- # Mongoid.database.collections.each do |collection|
- # unless collection.name =~ /^system\./
- # collection.remove
- # end
- # end
end
-
- # We filter out the specs that require authentication if the database has not
- # had the mongoid user set up properly.
- # user_configured = Support::Authentication.configured?
- # warn(Support::Authentication.message) unless user_configured
-
- # config.filter_run_excluding(:config => lambda { |value|
- # return true if value == :user && !user_configured
- # })
end