diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-02-27 12:18:45 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-02-27 12:18:45 -0800 |
commit | 1ceddd951449b8647dff7d2b4301477bc8b6b510 (patch) | |
tree | 5d641dfe2a0f76905ee5ef8722eaa85001125bc2 /railties | |
parent | eb217b2cf02af3d6533fb5b0e3fe87efa78cf43a (diff) | |
download | rails-1ceddd951449b8647dff7d2b4301477bc8b6b510.tar.gz rails-1ceddd951449b8647dff7d2b4301477bc8b6b510.tar.bz2 rails-1ceddd951449b8647dff7d2b4301477bc8b6b510.zip |
Skip backtrace filter test when using minitest
Diffstat (limited to 'railties')
-rw-r--r-- | railties/test/backtrace_cleaner_test.rb | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/railties/test/backtrace_cleaner_test.rb b/railties/test/backtrace_cleaner_test.rb index 5955fd2856..bfb9cb7639 100644 --- a/railties/test/backtrace_cleaner_test.rb +++ b/railties/test/backtrace_cleaner_test.rb @@ -3,26 +3,30 @@ require 'abstract_unit' require 'initializer' require 'rails/backtrace_cleaner' -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' ] +if defined? Test::Unit::Util::BacktraceFilter + class TestWithBacktrace + include Test::Unit::Util::BacktraceFilter + include Rails::BacktraceFilterForTestUnit 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.filter_backtrace(@backtrace) - end - - test "filter backtrace should have the same arity as Test::Unit::Util::BacktraceFilter" do - assert_nothing_raised do - @test.filter_backtrace(@backtrace, '/opt/local/lib') + + 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.filter_backtrace(@backtrace) + end + + test "filter backtrace should have the same arity as Test::Unit::Util::BacktraceFilter" do + assert_nothing_raised do + @test.filter_backtrace(@backtrace, '/opt/local/lib') + end end end -end
\ No newline at end of file +else + $stderr.puts 'No BacktraceFilter for minitest' +end |