diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2008-11-22 18:06:08 +0100 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2008-11-22 18:06:08 +0100 |
commit | f42c77f927eb49b00e84d355e07de48723d03fcb (patch) | |
tree | 2a459814a9708f292c99e9c5e99dd41d2d801353 /activesupport/lib/active_support/test_case.rb | |
parent | a026b4c983681b71d876ea37958c3e5bc605acac (diff) | |
download | rails-f42c77f927eb49b00e84d355e07de48723d03fcb.tar.gz rails-f42c77f927eb49b00e84d355e07de48723d03fcb.tar.bz2 rails-f42c77f927eb49b00e84d355e07de48723d03fcb.zip |
Added ActiveSupport::BacktraceCleaner and Rails::BacktraceCleaner for cutting down on backtrace noise (inspired by the Thoughtbot Quiet Backtrace plugin) [DHH]
Diffstat (limited to 'activesupport/lib/active_support/test_case.rb')
-rw-r--r-- | activesupport/lib/active_support/test_case.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/test_case.rb b/activesupport/lib/active_support/test_case.rb index 5b825b212d..d1e657c15f 100644 --- a/activesupport/lib/active_support/test_case.rb +++ b/activesupport/lib/active_support/test_case.rb @@ -21,15 +21,21 @@ module ActiveSupport Assertion = MiniTest::Assertion end + # TODO: Figure out how to get the Rails::BacktraceFilter into minitest/unit # Test::Unit compatibility. rescue LoadError require 'test/unit/testcase' require 'active_support/testing/default' + if defined?(Rails) + require 'rails/backtrace_cleaner' + Test::Unit::Util::BacktraceFilter.module_eval { include Rails::BacktraceFilterForTestUnit } + end + class TestCase < ::Test::Unit::TestCase Assertion = Test::Unit::AssertionFailedError include ActiveSupport::Testing::Default - end + end end class TestCase @@ -37,4 +43,4 @@ module ActiveSupport include ActiveSupport::Testing::Assertions extend ActiveSupport::Testing::Declarative end -end +end
\ No newline at end of file |