1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00
kaminari--kaminari/spec/spec_helper.rb
Akira Matsuda d0cb1837a1 refactor AR, DM, mongoid, and mongo_mapper specs
extract model definitions for each ORM under spec/fake_app, and load them only if target ORM is loaded
by this mechanism, all ORMs share a model name "User", and the other specs such as helper specs and request specs will run polymorphically
2012-05-23 12:44:13 +09:00

22 lines
614 B
Ruby

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rails'
require 'bundler/setup'
Bundler.require
require 'database_cleaner'
# Simulate a gem providing a subclass of ActiveRecord::Base before the Railtie is loaded.
require 'fake_gem' if defined? ActiveRecord
require 'fake_app/fake_app'
require 'rspec/rails'
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
RSpec.configure do |config|
config.mock_with :rr
end