diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2015-12-23 23:37:43 +0100 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2015-12-23 23:37:43 +0100 |
commit | 55cf46d44f95129c7a00681710ffb15d0bdcf948 (patch) | |
tree | 9cd2574ae694a3ab2276c998d7947a3f0ca568b6 /railties/lib | |
parent | 153e16ac770f865853dd8379f4053d7a21b67d74 (diff) | |
download | rails-55cf46d44f95129c7a00681710ffb15d0bdcf948.tar.gz rails-55cf46d44f95129c7a00681710ffb15d0bdcf948.tar.bz2 rails-55cf46d44f95129c7a00681710ffb15d0bdcf948.zip |
Rename color to color_output.
The word color is being thrown all around with slightly different meanings.
Right now, I understand it. But I'd like to be more immediately clear.
Diffstat (limited to 'railties/lib')
-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 |