summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
Diffstat (limited to 'sample')
-rwxr-xr-xsample/test.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/sample/test.rb b/sample/test.rb
index 85a11e0d4d..14f4d4a0f1 100755
--- a/sample/test.rb
+++ b/sample/test.rb
@@ -33,7 +33,13 @@ class Progress
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__, "../test/colors")).scan(/(\w+)=([^:\n]*)/) do |n, c|
+ colors[n] ||= c
+ end
+ rescue
+ end
@passed = "\e[;#{colors["pass"] || "32"}m"
@failed = "\e[;#{colors["fail"] || "31"}m"
@reset = "\e[m"