Class: TapOut::Reporters::Progressbar

Inherits:
Abstract
  • Object
show all
Defined in:
lib/tapout/reporters/progressbar.rb

Overview

The progressbar report format utilises a progress bar to indicate elapsed progress.

Constant Summary

Constants inherited from Abstract

Abstract::INTERNALS

Instance Method Summary collapse

Methods inherited from Abstract

#<<, #clean_backtrace, #code_snippet, #err, #finish_case, #handle, inherited, #initialize, #note, #parse_source_location, #source, #tally, #test

Constructor Details

This class inherits a constructor from TapOut::Reporters::Abstract

Instance Method Details

#error(message = nil) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/tapout/reporters/progressbar.rb', line 48

def error(message=nil)
  @pbar.clear

  puts
  message = entry['message'].strip
  message = message.ansi(:red)
  puts(message)
  puts "#{entry['file']}:#{entry['line']}"
  puts
  puts code_snippet(entry)
  puts

  @pbar.style(:bar=>:yellow)
  @pbar.inc
end

#fail(entry) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/tapout/reporters/progressbar.rb', line 31

def fail(entry)
  @pbar.clear

  puts
  message = entry['message'].strip
  message = message.ansi(:red)
  puts(message)
  puts "#{entry['file']}:#{entry['line']}"
  puts
  puts code_snippet(entry)
  puts

  @pbar.style(:bar=>:red)
  @pbar.inc
end

#finish_suite(entry) ⇒ Object

def finish_case(kase) end



77
78
79
80
81
82
# File 'lib/tapout/reporters/progressbar.rb', line 77

def finish_suite(entry)
  @pbar.finish
  #post_report(entry)
  puts
  puts tally(entry)
end

#omit(entry) ⇒ Object



65
66
67
# File 'lib/tapout/reporters/progressbar.rb', line 65

def omit(entry)
  @pbar.inc
end

#pass(entry) ⇒ Object

def test(entry)

#@pbar.inc

end



26
27
28
# File 'lib/tapout/reporters/progressbar.rb', line 26

def pass(entry)
  @pbar.inc
end

#skip(entry) ⇒ Object



70
71
72
# File 'lib/tapout/reporters/progressbar.rb', line 70

def skip(entry)
  @pbar.inc
end

#start_case(entry) ⇒ Object



19
20
# File 'lib/tapout/reporters/progressbar.rb', line 19

def start_case(entry)
end

#start_suite(entry) ⇒ Object



13
14
15
16
17
# File 'lib/tapout/reporters/progressbar.rb', line 13

def start_suite(entry)
  @pbar = ::ANSI::Progressbar.new('Testing', entry['count'].to_i + 1)
  @pbar.style(:bar=>:green)
  @pbar.inc
end