mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Test::Unit::Util::BacktraceFilter is never defined
This commit is contained in:
parent
056b8386d0
commit
f9382cd794
2 changed files with 0 additions and 33 deletions
|
@ -7,11 +7,6 @@ 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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue