Permalink
Browse files

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

…t initializers
  • Loading branch information...
1 parent 523002f commit 8afcd33246868af0b3f1888b38ae72a1f489f77e @jeremy jeremy committed Feb 11, 2010
@@ -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
@@ -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
@@ -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
Member
josh commented on 8afcd33 Feb 11, 2010

Hurray! 1 less boot initializer.

Please sign in to comment.