diff options
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/test_help.rb | 19 | ||||
-rw-r--r-- | railties/test/backtrace_cleaner_test.rb | 28 |
2 files changed, 6 insertions, 41 deletions
diff --git a/railties/lib/rails/test_help.rb b/railties/lib/rails/test_help.rb index 156c35b7a4..4455d92d69 100644 --- a/railties/lib/rails/test_help.rb +++ b/railties/lib/rails/test_help.rb @@ -7,21 +7,14 @@ require 'active_support/test_case' require 'action_controller/test_case' require 'action_dispatch/testing/integration' -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?(MiniTest) - # Enable turn if it is available - begin - require 'turn' +# Enable turn if it is available +begin + require 'turn' - if MiniTest::Unit.respond_to?(:use_natural_language_case_names=) - MiniTest::Unit.use_natural_language_case_names = true - end - rescue LoadError + if MiniTest::Unit.respond_to?(:use_natural_language_case_names=) + MiniTest::Unit.use_natural_language_case_names = true end +rescue LoadError end if defined?(ActiveRecord::Base) diff --git a/railties/test/backtrace_cleaner_test.rb b/railties/test/backtrace_cleaner_test.rb index 80077378db..cbe7d35f6d 100644 --- a/railties/test/backtrace_cleaner_test.rb +++ b/railties/test/backtrace_cleaner_test.rb @@ -1,34 +1,6 @@ require 'abstract_unit' require 'rails/backtrace_cleaner' -if defined? Test::Unit::Util::BacktraceFilter - class TestWithBacktrace - include Test::Unit::Util::BacktraceFilter - include Rails::BacktraceFilterForTestUnit - end - - class BacktraceCleanerFilterTest < ActiveSupport::TestCase - def setup - @test = TestWithBacktrace.new - @backtrace = [ './test/rails/benchmark_test.rb', './test/rails/dependencies.rb', '/opt/local/lib/ruby/kernel.rb' ] - end - - test "test with backtrace should use the rails backtrace cleaner to clean" do - Rails.stubs(:backtrace_cleaner).returns(stub(:clean)) - Rails.backtrace_cleaner.expects(:clean).with(@backtrace, nil) - @test.send(:filter_backtrace, @backtrace) - end - - test "filter backtrace should have the same arity as Test::Unit::Util::BacktraceFilter" do - assert_nothing_raised do - @test.send(:filter_backtrace, @backtrace, '/opt/local/lib') - end - end - end -else - $stderr.puts 'No BacktraceFilter for minitest' -end - if defined? Gem class BacktraceCleanerVendorGemTest < ActiveSupport::TestCase def setup |