Class: QED::Reporter::Dot
- Defined in:
- lib/qed/reporter/dotprogress.rb
Overview
The dot reporter is the traditional test reporter where dot is printed for every successful step, an ‘E’ for errors and an ‘F’ for failures.
Constant Summary
Constants inherited from Abstract
Instance Attribute Summary
Attributes inherited from Abstract
Instance Method Summary collapse
- #after_session(session) ⇒ Object
- #before_session(session) ⇒ Object
- #error(step, exception) ⇒ Object
- #fail(step, assertion) ⇒ Object
-
#pass(step) ⇒ Object
def before_step(step) super(step) io.print “.” io.flush end.
Methods inherited from Abstract
After, Before, When, #after_demo, #after_eval, #after_import, #after_proc, #after_step, #before_demo, #before_eval, #before_import, #before_proc, #before_step, #call, #count_demo, #count_error, #count_fail, #count_pass, #count_step, #demo, #demos, #errors, #eval, #fails, #import, #initialize, #omits, #passes, #proc, #rule, #step, #steps, #success?, #trace?
Constructor Details
This class inherits a constructor from QED::Reporter::Abstract
Instance Method Details
#after_session(session) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/qed/reporter/dotprogress.rb', line 44 def after_session(session) print_time errors.each do |step, exception| backtrace = sane_backtrace(exception) io.puts "***** ERROR *****".ansi(:red) io.puts "#{exception}" backtrace.each do |bt| io.puts bt io.puts code_snippet(bt) end io.puts end fails.each do |step, assertion| backtrace = sane_backtrace(assertion) io.puts "***** FAIL *****".ansi(:red, :bold) io.puts "#{assertion}" backtrace.each do |bt| io.puts bt io.puts code_snippet(bt) end io.puts end print_tally end |
#before_session(session) ⇒ Object
13 14 15 16 |
# File 'lib/qed/reporter/dotprogress.rb', line 13 def before_session(session) @start_time = Time.now io.puts "Started" end |
#error(step, exception) ⇒ Object
37 38 39 40 41 |
# File 'lib/qed/reporter/dotprogress.rb', line 37 def error(step, exception) io.print "E".ansi(:red) io.flush super(step, exception) end |
#fail(step, assertion) ⇒ Object
31 32 33 34 35 |
# File 'lib/qed/reporter/dotprogress.rb', line 31 def fail(step, assertion) io.print "F".ansi(:red) io.flush super(step, assertion) end |
#pass(step) ⇒ Object
def before_step(step)
super(step)
io.print "."
io.flush
end
25 26 27 28 29 |
# File 'lib/qed/reporter/dotprogress.rb', line 25 def pass(step) io.print "." io.flush super(step) end |