Sha256: 1775ab2419d4ceae569b30a9f1f896d8427d647f06db91b5c9da97edeb480205

Contents?: true

Size: 1.19 KB

Versions: 7

Compression:

Stored size: 1.19 KB

Contents

require 'simplecov'
SimpleCov.start 'rails'

ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../dummy/config/environment.rb',  __FILE__)
require 'rspec/rails'

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }

RSpec.configure do |config|
  # ## Mock Framework
  #
  # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
  #
  # config.mock_with :mocha
  # config.mock_with :flexmock
  # config.mock_with :rr

  # If true, the base class of anonymous controllers will be inferred
  # automatically. This will be the default behavior in future versions of
  # rspec-rails.
  config.infer_base_class_for_anonymous_controllers = false

  config.before :suite do
    if Mongoid::VERSION < '3'
      Mongoid.configure do |config|
        config.master = Mongo::Connection.new.db('media_magick')
      end
    else
      Mongoid.connect_to('media_magick')
    end
  end

  config.after :each do
    if Mongoid::VERSION < '3'
      Mongoid.master.collections.select { |c| c.name !~ /^system/ }.each(&:drop)
    else
      Mongoid::Config.purge!
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
media_magick-0.4.1 spec/spec_helper.rb
media_magick-0.4.0 spec/spec_helper.rb
media_magick-0.3.3 spec/spec_helper.rb
media_magick-0.3.2 spec/spec_helper.rb
media_magick-0.3.0 spec/spec_helper.rb
media_magick-0.2.0 spec/spec_helper.rb
media_magick-0.1.1 spec/spec_helper.rb