Class: MiniTest::Unit
- Inherits:
-
Object
- Object
- MiniTest::Unit
- Defined in:
- lib/colorific.rb
Constant Summary collapse
- ANSI_COLOR_CODES =
{ :clear => "\e[0m", :red => "\e[31m", :green => "\e[32m", :yellow => "\e[33m" }
- TEST_COLORS =
{ "F" => :red, "E" => :red, "S" => :yellow, "." => :green }
Instance Method Summary collapse
- #_run_suites(suites, type) ⇒ Object
- #original_puke ⇒ Object
- #original_run_suites ⇒ Object
- #original_status ⇒ Object
- #print(*a) ⇒ Object
- #puke(klass, meth, e) ⇒ Object
- #status(io = self.output) ⇒ Object
Instance Method Details
#_run_suites(suites, type) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/colorific.rb', line 25 def _run_suites(suites, type) @colorful_test_count = suites.reduce(0) { |mem, suite| mem + suite.send("#{type}_methods").size } @finished_count = 0 @progress_bar = ProgressBar.new(" #{test_count} tests", @colorful_test_count, output) original_run_suites(suites, type) end |
#original_puke ⇒ Object
9 |
# File 'lib/colorific.rb', line 9 alias :original_puke :puke |
#original_run_suites ⇒ Object
10 |
# File 'lib/colorific.rb', line 10 alias :original_run_suites :_run_suites |
#original_status ⇒ Object
11 |
# File 'lib/colorific.rb', line 11 alias :original_status :status |
#print(*a) ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/colorific.rb', line 36 def print(*a) if %w(. S F E).include?(a.join) set_color(a.join) increment else output.print(*a) end end |
#puke(klass, meth, e) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/colorific.rb', line 13 def puke(klass, meth, e) r = original_puke(klass, meth, e) if report = @report.pop lines = report.split(/\n/) lines[0] = tint(r, lines[0]) @report << lines.join("\n") end return r end |
#status(io = self.output) ⇒ Object
32 33 34 |
# File 'lib/colorific.rb', line 32 def status(io = self.output) with_color { original_status(io) } end |