summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-15 00:56:41 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-15 00:56:41 +0000
commitfa6a2e03248840f4cb2308457abfd58e1244327b (patch)
tree972f3b3bbab378c6277ebed141268d73b951cea4
parent0243943aad4302c1565c09d5a149fe1b96efd1ff (diff)
test: skipped color
* lib/test/unit.rb (Test::Unit::Runner#failed): use different color for Skipped. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--lib/test/unit.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/test/unit.rb b/lib/test/unit.rb
index 70cd942..ff489d6 100644
--- a/lib/test/unit.rb
+++ b/lib/test/unit.rb
@@ -680,9 +680,10 @@ module Test
colors = (colors = ENV['TEST_COLORS']) ? Hash[colors.scan(/(\w)=([^:]*)/)] : {}
@passed_color = "\e[#{colors["pass"] || "32"}m"
@failed_color = "\e[#{colors["fail"] || "31"}m"
+ @skipped_color = "\e[#{colors["skip"] || "33"}m"
@reset_color = "\e[m"
else
- @passed_color = @failed_color = @reset_color = ""
+ @passed_color = @failed_color = @skipped_color = @reset_color = ""
end
if color or @options[:job_status] == :replace
@options[:job_status] ||= :replace unless @verbose
@@ -714,10 +715,15 @@ module Test
sep = "\n"
@report_count ||= 0
report.each do |msg|
- next if @options[:hide_skip] and msg.start_with? "Skipped:"
+ if msg.start_with? "Skipped:"
+ next if @options[:hide_skip]
+ color = @skipped_color
+ else
+ color = @failed_color
+ end
msg = msg.split(/$/, 2)
$stdout.printf("%s%s%3d) %s%s%s\n",
- sep, @failed_color, @report_count += 1,
+ sep, color, @report_count += 1,
msg[0], @reset_color, msg[1])
sep = nil
end