Sha256: b7f8544419cdb20e2ec7d7eade0d174f5a0b34f798fdbbeba54a47ad38aeee83

Contents?: true

Size: 1.25 KB

Versions: 3

Compression:

Stored size: 1.25 KB

Contents

module QED
module Reporter #:nodoc:

  require 'qed/reporter/base'

  # = DotProgress Reporter
  #
  class DotProgress < BaseClass

    #
    def before_session(session)
      @start_time = Time.now
      io.puts "Started"
    end

    #
    def before_code(step, file)
      super(step, file)
      io.print "." if step.name == 'pre'
    end

    #
    def after_session(session)
      io.puts "\nFinished in #{Time.now - @start_time} seconds.\n\n"

      @error.each do |step, exception|
        backtrace = clean_backtrace(exception.backtrace[0])
        io.puts ANSI::Code.red("***** ERROR *****")
        io.puts "#{exception}"
        io.puts ":#{backtrace}:"
        #io.puts ":#{exception.backtrace[1]}:"
        #io.puts exception.backtrace[1..-1] if $VERBOSE
        io.puts
      end

      @fail.each do |step, assertion|
        backtrace = clean_backtrace(assertion.backtrace[0])
        io.puts ANSI::Code.red("***** FAIL *****")
        io.puts ANSI::Code.bold("#{assertion}")
        io.puts ":#{backtrace}:"
        #io.puts assertion if $VERBOSE
        io.puts
      end

      io.puts "%s demos, %s steps, %s failures, %s errors" % [@demos, @steps, @fail.size, @error.size] #, @pass.size ]
    end

  end#class DotProgress

end#module Reporter
end#module QED

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
qed-2.1.1 lib/qed/reporter/dotprogress.rb
qed-2.0.0 lib/qed/reporter/dotprogress.rb
qed-2.1.0 lib/qed/reporter/dotprogress.rb