Skip to content
Browse files

Add backtrace cleaner on test unit railtie.

  • Loading branch information...
1 parent de69c79 commit 345e0b274cb384f8d453256e90dd105e6c2ffa19 @josevalim josevalim committed Feb 7, 2010
Showing with 8 additions and 6 deletions.
  1. +0 −6 activesupport/lib/active_support/test_case.rb
  2. +8 −0 railties/lib/rails/test_unit/railtie.rb
View
6 activesupport/lib/active_support/test_case.rb
@@ -21,12 +21,6 @@ class TestCase < ::Test::Unit::TestCase
alias_method :method_name, :name if method_defined? :name
alias_method :method_name, :__name__ if method_defined? :__name__
else
- # TODO: Figure out how to get the Rails::BacktraceFilter into minitest/unit
- if defined?(Rails) && ENV['BACKTRACE'].nil?
- require 'rails/backtrace_cleaner'
- Test::Unit::Util::BacktraceFilter.module_eval { include Rails::BacktraceFilterForTestUnit }
- end
-
Assertion = Test::Unit::AssertionFailedError
require 'active_support/testing/default'
View
8 railties/lib/rails/test_unit/railtie.rb
@@ -13,5 +13,13 @@ 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
+ unless defined?(Minitest) || ENV['BACKTRACE']
+ require 'rails/backtrace_cleaner'
+ Test::Unit::Util::BacktraceFilter.module_eval { include Rails::BacktraceFilterForTestUnit }
+ end
+ end
end
end

0 comments on commit 345e0b2

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