File tree 1 file changed +17
-4
lines changed 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 27
27
description = error_line . match ( ERROR_OR_FAILED ) . pre_match
28
28
29
29
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
33
46
end
34
- spec_file = spec_file [ SPEC_FILE , 1 ]
47
+
35
48
prefix = spec_file . index ( 'spec/ruby/' ) || spec_file . index ( 'spec/truffle/' )
36
49
spec_file = spec_file [ prefix ..-1 ]
37
50
You can’t perform that action at this time.
0 commit comments