зеркало из https://github.com/github/ruby.git
Update to ruby/mspec@d03ad9c
This commit is contained in:
Родитель
58d1fbcf3f
Коммит
b09618e566
|
@ -3,6 +3,8 @@
|
|||
# Adds tags based on error and failures output (e.g., from a CI log),
|
||||
# without running any spec code.
|
||||
|
||||
tag = ENV["TAG"] || "fails"
|
||||
|
||||
tags_dir = %w[
|
||||
spec/tags
|
||||
spec/tags/ruby
|
||||
|
@ -30,9 +32,9 @@ output.slice_before(NUMBER).select { |number, *rest|
|
|||
if spec_file
|
||||
spec_file = spec_file[SPEC_FILE, 1] or raise
|
||||
else
|
||||
if error_line =~ /^(\w+)[#\.](\w+) /
|
||||
module_method = error_line.split(' ', 2).first
|
||||
file = "#{$1.downcase}/#{$2}_spec.rb"
|
||||
if error_line =~ /^([\w:]+)[#\.](\w+) /
|
||||
mod, method = $1, $2
|
||||
file = "#{mod.downcase.gsub('::', '/')}/#{method}_spec.rb"
|
||||
spec_file = ['spec/ruby/core', 'spec/ruby/library', *Dir.glob('spec/ruby/library/*')].find { |dir|
|
||||
path = "#{dir}/#{file}"
|
||||
break path if File.exist?(path)
|
||||
|
@ -54,7 +56,7 @@ output.slice_before(NUMBER).select { |number, *rest|
|
|||
dir = File.dirname(tags_file)
|
||||
Dir.mkdir(dir) unless Dir.exist?(dir)
|
||||
|
||||
tag_line = "fails:#{description}"
|
||||
tag_line = "#{tag}:#{description}"
|
||||
lines = File.exist?(tags_file) ? File.readlines(tags_file, chomp: true) : []
|
||||
unless lines.include?(tag_line)
|
||||
puts tags_file
|
||||
|
|
Загрузка…
Ссылка в новой задаче