Sha256: e612cca51a48c0bd632a0c5b4feee0db39b2d8fa7254e844d37237b137306a03

Contents?: true

Size: 1 KB

Versions: 4

Compression:

Stored size: 1 KB

Contents

module QED
module Reporter #:nodoc:

  require 'qed/reporter/abstract'

  #  Deep trace reporter
  #
  class DTrace < Abstract

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

    #
    #def before_step(step)
    #  super(step)
    #  io.print "."
    #  io.flush
    #end

    def pass(step)
      super(step)
    end

    #
    def fail(step, assertion)
      super(step, assertion)

      io.puts "#{assertion}".ansi(:red)

      backtrace = sane_backtrace(assertion)
      backtrace.each do |bt|
        io.puts bt
        io.puts code_snippet(bt)
      end

      io.puts
    end

    #
    def error(step, exception)
      super(step, exception)

      io.puts "#{exception}".ansi(:red)

      backtrace = sane_backtrace(exception)
      backtrace.each do |bt|
        io.puts bt
        io.puts code_snippet(bt)
      end

      io.puts
    end


    #
    def after_session(session)
      print_time
      print_tally
    end

  end

end#module Reporter
end#module QED

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
qed-2.6.3 lib/qed/reporter/dtrace.rb
qed-2.6.2 lib/qed/reporter/dtrace.rb
qed-2.6.1 lib/qed/reporter/dtrace.rb
qed-2.6.0 lib/qed/reporter/dtrace.rb