Permalink
Browse files

Squash errors caused by initializing the faux Rails app out of order

  • Loading branch information...
1 parent 3d3095a commit c253a5548f3fd4d298fd90a00017be6b2014c845 @laserlemon laserlemon committed Apr 24, 2012
Showing with 6 additions and 35 deletions.
  1. +5 −5 Rakefile
  2. +0 −17 spec/rails_app/config/application.rb
  3. +0 −13 spec/rails_app/config/boot.rb
  4. +1 −0 spec/spec_helper.rb
View
@@ -1,9 +1,13 @@
#!/usr/bin/env rake
-require 'rspec/core/rake_task'
require 'bundler/gem_helper'
+require 'rspec/core/rake_task'
require 'appraisal'
+Bundler::GemHelper.install_tasks(:name => 'audited')
+Bundler::GemHelper.install_tasks(:name => 'audited-activerecord')
+Bundler::GemHelper.install_tasks(:name => 'audited-mongo_mapper')
+
ADAPTERS = %w(active_record mongo_mapper)
ADAPTERS.each do |adapter|
@@ -18,7 +22,3 @@ RSpec::Core::RakeTask.new(:spec => ADAPTERS) do |t|
end
task :default => :spec
-
-Bundler::GemHelper.install_tasks(:name => 'audited')
-Bundler::GemHelper.install_tasks(:name => 'audited-activerecord')
-Bundler::GemHelper.install_tasks(:name => 'audited-mongo_mapper')
@@ -1,22 +1,5 @@
-require File.expand_path('../boot', __FILE__)
-
-require "rails/all"
-
-Bundler.require :default
-
module RailsApp
class Application < Rails::Application
- # Ensure the root is correct
config.root = File.expand_path('../../', __FILE__)
-
- # Configure generators values. Many other options are available, be sure to check the documentation.
- # config.generators do |g|
- # g.orm :active_record
- # g.template_engine :erb
- # g.test_framework :test_unit, :fixture => true
- # end
-
- # Configure sensitive parameters which will be filtered from the log file.
- config.filter_parameters << :password
end
end
@@ -1,13 +0,0 @@
-unless defined?(DEVISE_ORM)
- DEVISE_ORM = (ENV["DEVISE_ORM"] || :active_record).to_sym
-end
-
-begin
- require File.expand_path("../../../../.bundle/environment", __FILE__)
-rescue LoadError
- require 'rubygems'
- require 'bundler'
- Bundler.setup :default, DEVISE_ORM
-end
-
-$:.unshift File.expand_path('../../../../lib', __FILE__)
View
@@ -1,5 +1,6 @@
ENV['RAILS_ENV'] = 'test'
+require 'rails/all'
require 'rails_app/config/environment'
require 'rspec/rails'
require 'audited'

0 comments on commit c253a55

Please sign in to comment.