lib/diesel/testing/application.rb in diesel-0.1.4 vs lib/diesel/testing/application.rb in diesel-0.1.5

- old
+ new

@@ -5,15 +5,23 @@ APP_ROOT = File.expand_path('..', __FILE__).freeze class Application < Rails::Application config.encoding = "utf-8" config.action_mailer.default_url_options = { :host => 'localhost' } - config.paths.config.database = "#{APP_ROOT}/config/database.yml" - config.paths.config.routes << "#{APP_ROOT}/config/routes.rb" - config.paths.app.controllers << "#{APP_ROOT}/app/controllers" - config.paths.app.views << "#{APP_ROOT}/app/views" - config.paths.log = "tmp/log" + if Rails::VERSION::MAJOR >= 3 && Rails::VERSION::MINOR >= 1 + config.paths['config/database'] = "#{APP_ROOT}/config/database.yml" + config.paths['config/routes'] << "#{APP_ROOT}/config/routes.rb" + config.paths['app/controllers'] << "#{APP_ROOT}/app/controllers" + config.paths['app/views'] << "#{APP_ROOT}/app/views" + config.paths['log'] = "tmp/log/development.log" + else + config.paths.config.database = "#{APP_ROOT}/config/database.yml" + config.paths.config.routes << "#{APP_ROOT}/config/routes.rb" + config.paths.app.controllers << "#{APP_ROOT}/app/controllers" + config.paths.app.views << "#{APP_ROOT}/app/views" + config.paths.log = "tmp/log" + end config.cache_classes = true config.whiny_nils = true config.consider_all_requests_local = true config.action_controller.perform_caching = false config.action_dispatch.show_exceptions = false @@ -26,10 +34,10 @@ initialize! end def initialize! FileUtils.mkdir_p(Rails.root.join("db").to_s) - super + super unless @initialized end end end end