diff options
-rw-r--r-- | railties/lib/rails/test_unit/reporter.rb | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/railties/lib/rails/test_unit/reporter.rb b/railties/lib/rails/test_unit/reporter.rb index fa48abc776..b97d6f86f2 100644 --- a/railties/lib/rails/test_unit/reporter.rb +++ b/railties/lib/rails/test_unit/reporter.rb @@ -24,15 +24,15 @@ module Rails color = COLOR_CODES_FOR_RESULTS[result.result_code] if options[:verbose] - io.puts color(format_line(result), color) + io.puts color_output(format_line(result), color) else - io.print color(result.result_code, color) + io.print color_output(result.result_code, color) end if output_inline? && result.failure && (!result.skipped? || options[:verbose]) io.puts io.puts - io.puts format_failures(result).map { |line| color(line, color) } + io.puts format_failures(result).map { |line| color_output(line, color) } io.puts io.puts format_rerun_snippet(result) io.puts @@ -105,10 +105,9 @@ module Rails options[:color] && io.respond_to?(:tty?) && io.tty? end - def color(string, color) + def color_output(string, color) if colored_output? - color = COLOR_CODES[color] - "\e[#{color}m#{string}\e[0m" + "\e[#{COLOR_CODES[color]}m#{string}\e[0m" else string end |