summaryrefslogtreecommitdiff
path: root/spec/mspec
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2019-05-30 22:11:22 +0200
committerBenoit Daloze <eregontp@gmail.com>2019-05-30 22:11:22 +0200
commite935a3227d1553539f65d1475f2c161082ba7148 (patch)
treeb460cb7a0e5c23641e11ce4f12e7fbe4d8b2aae4 /spec/mspec
parentc55db6aa271df4a689dc8eb0039c929bf6ed43ff (diff)
Update to ruby/mspec@3cc36d0
Diffstat (limited to 'spec/mspec')
-rw-r--r--spec/mspec/Gemfile.lock3
-rw-r--r--spec/mspec/tool/sync/sync-rubyspec.rb2
-rwxr-xr-x[-rw-r--r--]spec/mspec/tool/tag_from_output.rb13
3 files changed, 7 insertions, 11 deletions
diff --git a/spec/mspec/Gemfile.lock b/spec/mspec/Gemfile.lock
index e977989f8c..ce0aa98417 100644
--- a/spec/mspec/Gemfile.lock
+++ b/spec/mspec/Gemfile.lock
@@ -19,6 +19,3 @@ PLATFORMS
DEPENDENCIES
rake (~> 10.0)
rspec (~> 2.14.1)
-
-BUNDLED WITH
- 1.16.1
diff --git a/spec/mspec/tool/sync/sync-rubyspec.rb b/spec/mspec/tool/sync/sync-rubyspec.rb
index 0a6203e357..2da7f8edb9 100644
--- a/spec/mspec/tool/sync/sync-rubyspec.rb
+++ b/spec/mspec/tool/sync/sync-rubyspec.rb
@@ -190,7 +190,7 @@ def verify_commits(impl)
puts "Manually check commit messages:"
print "Press enter >"
STDIN.gets
- sh "git", "log", "master..."
+ system "git", "log", "master..."
end
end
diff --git a/spec/mspec/tool/tag_from_output.rb b/spec/mspec/tool/tag_from_output.rb
index 62764c3ff5..1802aa9261 100644..100755
--- a/spec/mspec/tool/tag_from_output.rb
+++ b/spec/mspec/tool/tag_from_output.rb
@@ -1,3 +1,5 @@
+#!/usr/bin/env ruby
+
# Adds tags based on error and failures output (e.g., from a CI log),
# without running any spec code.
@@ -8,14 +10,12 @@ tags_dir = %w[
abort 'Could not find tags directory' unless tags_dir
output = ARGF.readlines
-# Remove leading "[exec] " from JRuby logs
-output = output.map { |line| line.sub(/^\[exec\] /, '') }
NUMBER = /^\d+\)$/
ERROR_OR_FAILED = / (ERROR|FAILED)$/
SPEC_FILE = /^(\/.+_spec\.rb)\:\d+/
-failures = output.slice_before(NUMBER).select { |number, error_line, *rest|
+output.slice_before(NUMBER).select { |number, error_line, *rest|
number =~ NUMBER and error_line =~ ERROR_OR_FAILED
}.each { |number, error_line, *rest|
description = error_line.match(ERROR_OR_FAILED).pre_match
@@ -31,9 +31,8 @@ failures = output.slice_before(NUMBER).select { |number, error_line, *rest|
Dir.mkdir(dir) unless Dir.exist?(dir)
tag_line = "fails:#{description}"
- unless File.exist?(tags_file) and File.readlines(tags_file, chomp: true).include?(tag_line)
- File.open(tags_file, 'a') do |f|
- f.puts tag_line
- end
+ lines = File.exist?(tags_file) ? File.readlines(tags_file, chomp: true) : []
+ unless lines.include?(tag_line)
+ File.write(tags_file, (lines + [tag_line]).join("\n") + "\n")
end
}