Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed colored output.

  • Loading branch information...
commit 3603747d493d61fc7e00ecaf71d58c9b55afac62 1 parent 12dc861
@iafonov authored
Showing with 11 additions and 2 deletions.
  1. +11 −2 files/default/reporters/console_reporter.rb
View
13 files/default/reporters/console_reporter.rb
@@ -1,11 +1,20 @@
class ConsoleReporter
def success(report)
puts report
- puts 'Test Suite OK'
+ puts green('Test Suite OK')
end
def fail(report)
puts report
- puts 'Test Suite Failed'
+ puts red('Test Suite Failed')
+ end
+
+private
+
+ def red(text); colorize(text, "\e[31m"); end
+ def green(text); colorize(text, "\e[32m"); end
+
+ def colorize(text, color_code)
+ "#{color_code}#{text}\e[0m"
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.