summaryrefslogtreecommitdiff
path: root/test/lib/test/unit.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/lib/test/unit.rb')
-rw-r--r--test/lib/test/unit.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/lib/test/unit.rb b/test/lib/test/unit.rb
index 996134eaf3..9d9ff4bdf3 100644
--- a/test/lib/test/unit.rb
+++ b/test/lib/test/unit.rb
@@ -596,7 +596,13 @@ module Test
end
if color
# dircolors-like style
- colors = (colors = ENV['TEST_COLORS']) ? Hash[colors.scan(/(\w+)=([^:]*)/)] : {}
+ colors = (colors = ENV['TEST_COLORS']) ? Hash[colors.scan(/(\w+)=([^:\n]*)/)] : {}
+ begin
+ File.read(File.join(__dir__, "../../colors")).scan(/(\w+)=([^:\n]*)/) do |n, c|
+ colors[n] ||= c
+ end
+ rescue
+ end
@passed_color = "\e[;#{colors["pass"] || "32"}m"
@failed_color = "\e[;#{colors["fail"] || "31"}m"
@skipped_color = "\e[;#{colors["skip"] || "33"}m"