Class: Quarry::Reporter::DotProgress
- Inherits:
-
Quarry::Reporter
- Object
- Quarry::Reporter
- Quarry::Reporter::DotProgress
- Defined in:
- lib/quarry/reporter/dotprogress.rb
Constant Summary
Constants inherited from Quarry::Reporter
Instance Attribute Summary
Attributes inherited from Quarry::Reporter
Instance Method Summary collapse
- #report_intro ⇒ Object
- #report_step(step) ⇒ Object
-
#report_summary ⇒ Object
def report(str) count = 1 unless count.empty? str = str.chomp(‘.’) ‘.’ str = count.join(‘.’) + ‘ ’ + str puts str.strip end.
Methods inherited from Quarry::Reporter
#initialize, #report_comment, #report_end, #report_error, #report_fail, #report_header, #report_macro, #report_pass, #report_start, #report_step_end
Constructor Details
This class inherits a constructor from Quarry::Reporter
Instance Method Details
#report_intro ⇒ Object
11 12 13 14 |
# File 'lib/quarry/reporter/dotprogress.rb', line 11 def report_intro @start_time = Time.now puts "Started" end |
#report_step(step) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/quarry/reporter/dotprogress.rb', line 17 def report_step(step) super #if step.code print "." #str = "(%s) %s" % [count.join('.'), str.tab(6).strip] #puts "* #{step.text.tab(2).strip}" #puts "\n#{step.code}\n" if $VERBOSE #else #puts "\n#{step.text}" #end end |
#report_summary ⇒ Object
def report(str)
count[-1] += 1 unless count.empty?
str = str.chomp('.') + '.'
str = count.join('.') + ' ' + str
puts str.strip
end
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/quarry/reporter/dotprogress.rb', line 36 def report_summary puts "\nFinished in #{Time.now - @start_time} seconds.\n\n" @error.each do |step, exception| puts ANSICode.red("***** ERROR *****") puts "#{exception}" puts ":#{exception.backtrace[0]}:" #puts ":#{exception.backtrace[1]}:" #puts exception.backtrace[1..-1] if $VERBOSE puts end @fail.each do |step, assertion| puts ANSICode.red("***** FAIL *****") puts ANSICode.bold("#{assertion}") puts ":#{assertion.backtrace[2]}:" #puts assertion if $VERBOSE puts end puts "%s specs, %s steps, %s failures, %s errors" % [@specs, @steps, @fail.size, @error.size] #, @pass.size ] end |