Sha256: 81eea4baf3ea59316db9ccd880a018c13dea5ec7f96ca7d111477d82dabeaba3

Contents?: true

Size: 1.21 KB

Versions: 15

Compression:

Stored size: 1.21 KB

Contents

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

MODELS = File.join(File.dirname(__FILE__), "models")
SUPPORT = File.join(File.dirname(__FILE__), "support")
$LOAD_PATH.unshift(MODELS)
$LOAD_PATH.unshift(SUPPORT)

require "mongoid"
require "mocha"
require "rspec"
require "mongoid_spacial"

LOGGER = Logger.new($stdout)

if RUBY_VERSION >= '1.9.2'
  YAML::ENGINE.yamler = 'syck'
end

Mongoid.configure do |config|
  name = "mongoid_spacial_test"
  config.master = Mongo::Connection.new.db(name)
  config.logger = nil
  config.allow_dynamic_fields = true
end

Dir[ File.join(MODELS, "*.rb") ].sort.each { |file| require File.basename(file) }
Dir[ File.join(SUPPORT, "*.rb") ].each { |file| require File.basename(file) }

RSpec.configure do |config|
  config.mock_with(:mocha)

  config.after(:suite) { Mongoid.purge! }

  # 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

Version data entries

15 entries across 15 versions & 3 rubygems

Version Path
sig_mongoid_spacial-0.2.17 spec/spec_helper.rb
cb_mongoid_spacial-0.2.16 spec/spec_helper.rb
mongoid_spacial-0.2.16 spec/spec_helper.rb
mongoid_spacial-0.2.13 spec/spec_helper.rb
mongoid_spacial-0.2.12 spec/spec_helper.rb
mongoid_spacial-0.2.11 spec/spec_helper.rb
mongoid_spacial-0.2.10 spec/spec_helper.rb
mongoid_spacial-0.2.8 spec/spec_helper.rb
mongoid_spacial-0.2.7 spec/spec_helper.rb
mongoid_spacial-0.2.6 spec/spec_helper.rb
mongoid_spacial-0.2.5 spec/spec_helper.rb
mongoid_spacial-0.2.4 spec/spec_helper.rb
mongoid_spacial-0.2.3 spec/spec_helper.rb
mongoid_spacial-0.2.2 spec/spec_helper.rb
mongoid_spacial-0.2.0 spec/spec_helper.rb