Permalink
Browse files

Fixed colored output.

  • Loading branch information...
1 parent 12dc861 commit 3603747d493d61fc7e00ecaf71d58c9b55afac62 @iafonov committed Aug 8, 2012
Showing with 11 additions and 2 deletions.
  1. +11 −2 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

0 comments on commit 3603747

Please sign in to comment.