Class: Quarry::Spec::Reporter::DotProgress

Inherits:
Quarry::Spec::Reporter show all
Defined in:
lib/quarry/spec/reporter/dotprogress.rb

Constant Summary

Constants inherited from Quarry::Spec::Reporter

ANSICode

Instance Attribute Summary

Attributes inherited from Quarry::Spec::Reporter

#error, #fail, #pass, #steps

Instance Method Summary collapse

Methods inherited from Quarry::Spec::Reporter

#initialize, #report_comment, #report_end, #report_error, #report_fail, #report_header, #report_mode, #report_pass, #report_start

Constructor Details

This class inherits a constructor from Quarry::Spec::Reporter

Instance Method Details

#report_introObject



12
13
14
15
# File 'lib/quarry/spec/reporter/dotprogress.rb', line 12

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/spec/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_summaryObject

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/spec/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