File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -2271,7 +2271,7 @@ def recover(argv)
22712271 DIR = File . join ( __dir__ , '' )
22722272 def self . filter_backtrace ( array )
22732273 unless $DEBUG
2274- array . delete_if { |bt | bt . start_with? ( DIR ) }
2274+ array . delete_if { |bt | ( bt . respond_to? ( :path ) ? bt . path : bt ) . start_with? ( DIR ) }
22752275 end
22762276 array
22772277 end
Original file line number Diff line number Diff line change @@ -178,6 +178,12 @@ def test_nonopt_pattern
178178 assert_equal ( [ "-t" ] , e . args )
179179 end
180180
181+ def test_parse_error_set_backtrace
182+ e = assert_raise ( OptionParser ::InvalidOption ) { @opt . parse ( %w( -t ) ) }
183+ assert_nothing_raised { e . set_backtrace ( e . backtrace ) }
184+ assert_nothing_raised { e . set_backtrace ( e . backtrace_locations ) }
185+ end
186+
181187 def test_help_pager
182188 require 'tmpdir'
183189 Dir . mktmpdir do |dir |
You can’t perform that action at this time.
0 commit comments