2011-02-05 08:32:10 -05:00
|
|
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
|
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
2011-02-05 08:54:09 -05:00
|
|
|
require 'rails'
|
2011-02-17 22:33:56 -05:00
|
|
|
require 'mongoid'
|
2011-05-23 09:30:00 -04:00
|
|
|
require 'dm-core'
|
2011-02-05 08:32:10 -05:00
|
|
|
require 'kaminari'
|
2011-04-02 01:27:28 -04:00
|
|
|
require 'database_cleaner'
|
2011-02-19 06:54:32 -05:00
|
|
|
# Ensure we use 'syck' instead of 'psych' in 1.9.2
|
|
|
|
# RubyGems >= 1.5.0 uses 'psych' on 1.9.2, but
|
|
|
|
# Psych does not yet support YAML 1.1 merge keys.
|
|
|
|
# Merge keys is often used in mongoid.yml
|
|
|
|
# See: http://redmine.ruby-lang.org/issues/show/4300
|
|
|
|
if RUBY_VERSION >= '1.9.2'
|
|
|
|
YAML::ENGINE.yamler = 'syck'
|
|
|
|
end
|
2011-05-20 18:17:28 -04:00
|
|
|
require File.join(File.dirname(__FILE__), 'fake_gem')
|
2011-02-11 10:07:26 -05:00
|
|
|
require File.join(File.dirname(__FILE__), 'fake_app')
|
2011-02-05 08:54:09 -05:00
|
|
|
|
2011-02-07 20:05:19 -05:00
|
|
|
require 'rspec/rails'
|
2011-02-05 08:32:10 -05:00
|
|
|
# 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|
|
2011-02-05 08:54:09 -05:00
|
|
|
config.mock_with :rr
|
|
|
|
config.before :all do
|
|
|
|
# ActiveRecord::Base.connection.execute 'CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))' unless ActiveRecord::Base.connection.table_exists? 'users'
|
2011-02-11 10:07:26 -05:00
|
|
|
CreateAllTables.up unless ActiveRecord::Base.connection.table_exists? 'users'
|
2011-02-05 08:54:09 -05:00
|
|
|
end
|
2011-02-05 08:32:10 -05:00
|
|
|
end
|