File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 2727 description = error_line . match ( ERROR_OR_FAILED ) . pre_match
2828
2929 spec_file = rest . find { |line | line =~ SPEC_FILE }
30- unless spec_file
31- warn "Could not find file for:\n #{ error_line } "
32- next
30+ if spec_file
31+ spec_file = spec_file [ SPEC_FILE , 1 ] or raise
32+ else
33+ if error_line =~ /^(\w +)#(\w +) /
34+ module_method = error_line . split ( ' ' , 2 ) . first
35+ file = "#{ $1. downcase } /#{ $2} _spec.rb"
36+ spec_file = [ 'spec/ruby/core' , 'spec/ruby/library' , *Dir . glob ( 'spec/ruby/library/*' ) ] . find { |dir |
37+ path = "#{ dir } /#{ file } "
38+ break path if File . exist? ( path )
39+ }
40+ end
41+
42+ unless spec_file
43+ warn "Could not find file for:\n #{ error_line } "
44+ next
45+ end
3346 end
34- spec_file = spec_file [ SPEC_FILE , 1 ]
47+
3548 prefix = spec_file . index ( 'spec/ruby/' ) || spec_file . index ( 'spec/truffle/' )
3649 spec_file = spec_file [ prefix ..-1 ]
3750
You can’t perform that action at this time.
0 commit comments