Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Resolve test/unit load ordering by removing backtrace filter from boo…

…t initializers
  • Loading branch information...
commit 8afcd33246868af0b3f1888b38ae72a1f489f77e 1 parent 523002f
@jeremy jeremy authored
View
3  railties/lib/generators/rails/app/templates/test/test_helper.rb
@@ -1,6 +1,5 @@
ENV["RAILS_ENV"] = "test"
-require 'test/unit'
-require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
+require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
class ActiveSupport::TestCase
View
6 railties/lib/rails/test_help.rb
@@ -5,6 +5,12 @@
require 'test/unit'
require 'active_support/core_ext/kernel/requires'
+# TODO: Figure out how to get the Rails::BacktraceFilter into minitest/unit
+if defined?(Test::Unit::Util::BacktraceFilter) && ENV['BACKTRACE'].nil?
+ require 'rails/backtrace_cleaner'
+ Test::Unit::Util::BacktraceFilter.module_eval { include Rails::BacktraceFilterForTestUnit }
+end
+
if defined?(ActiveRecord)
class ActiveSupport::TestCase
include ActiveRecord::TestFixtures
View
10 railties/lib/rails/test_unit/railtie.rb
@@ -13,13 +13,5 @@ class TestUnitRailtie < Rails::Railtie
rake_tasks do
load "rails/test_unit/testing.rake"
end
-
- initializer "test_unit.backtrace_cleaner" do
- # TODO: Figure out how to get the Rails::BacktraceFilter into minitest/unit
- if defined?(Test::Unit::Util::BacktraceFilter) && ENV['BACKTRACE'].nil?
- require 'rails/backtrace_cleaner'
- Test::Unit::Util::BacktraceFilter.module_eval { include Rails::BacktraceFilterForTestUnit }
- end
- end
end
-end
+end

1 comment on commit 8afcd33

@josh
Collaborator

Hurray! 1 less boot initializer.

Please sign in to comment.
Something went wrong with that request. Please try again.