diff options
author | José Valim <jose.valim@gmail.com> | 2010-02-07 14:36:50 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-02-07 14:51:23 +0100 |
commit | 518b4ff478984b74085239b0aa69fe67f7c01d9a (patch) | |
tree | e2e3c5aa614c7c9a00b480428057afd84de13435 /railties/test/application | |
parent | d6ae930c9cfacf50d65b2880ac21efe80801a33d (diff) | |
download | rails-518b4ff478984b74085239b0aa69fe67f7c01d9a.tar.gz rails-518b4ff478984b74085239b0aa69fe67f7c01d9a.tar.bz2 rails-518b4ff478984b74085239b0aa69fe67f7c01d9a.zip |
Check if Test::Unit is defined before adding backtrace filter.
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/test_test.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/railties/test/application/test_test.rb b/railties/test/application/test_test.rb index 37175783d8..de316a6fd0 100644 --- a/railties/test/application/test_test.rb +++ b/railties/test/application/test_test.rb @@ -23,6 +23,23 @@ module ApplicationTests run_test 'unit/foo_test.rb' end + # Run just in Ruby < 1.9 + if defined?(Test::Unit::Util::BacktraceFilter) + test "adds backtrace cleaner" do + app_file 'test/unit/backtrace_test.rb', <<-RUBY + require 'test_helper' + + class FooTest < ActiveSupport::TestCase + def test_truth + assert Test::Unit::Util::BacktraceFilter.ancestors.include?(Rails::BacktraceFilterForTestUnit) + end + end + RUBY + + run_test 'unit/backtrace_test.rb' + end + end + test "integration test" do controller 'posts', <<-RUBY class PostsController < ActionController::Base |