diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-08-29 13:44:03 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-08-29 15:05:30 +0900 |
commit | 141102b0b08c4feb682210033cac8d0f042c4beb (patch) | |
tree | b93ca7dc2f6849cef12e5ea7425939ce5aa4f40e /tool/lib/test | |
parent | 589cd0e511304be1419d4d7191eaf1063ef83fd5 (diff) |
Expose Test.filter_backtrace for the default gems.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/8313
Diffstat (limited to 'tool/lib/test')
-rw-r--r-- | tool/lib/test/unit.rb | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/tool/lib/test/unit.rb b/tool/lib/test/unit.rb index 68d2ab471e..23dfbd8f0f 100644 --- a/tool/lib/test/unit.rb +++ b/tool/lib/test/unit.rb @@ -24,42 +24,6 @@ require 'optparse' # See Test::Unit module Test - class << self - ## - # Filter object for backtraces. - - attr_accessor :backtrace_filter - end - - class BacktraceFilter # :nodoc: - def filter bt - return ["No backtrace"] unless bt - - new_bt = [] - pattern = %r[/(?:lib\/test/|core_assertions\.rb:)] - - unless $DEBUG then - bt.each do |line| - break if pattern.match?(line) - new_bt << line - end - - new_bt = bt.reject { |line| pattern.match?(line) } if new_bt.empty? - new_bt = bt.dup if new_bt.empty? - else - new_bt = bt.dup - end - - new_bt - end - end - - self.backtrace_filter = BacktraceFilter.new - - def self.filter_backtrace bt # :nodoc: - backtrace_filter.filter bt - end - ## # Test::Unit is an implementation of the xUnit testing framework for Ruby. module Unit |