Sha256: 52591750e61add4c1f01d6050d2a26ace629f3c624c2a7a4fc1b79d54aa63f06

Contents?: true

Size: 1.64 KB

Versions: 1

Compression:

Stored size: 1.64 KB

Contents

require 'quarry/spec/reporter'

module Quarry

  module Spec #:nodoc:

    class Reporter #:nodoc:

      # = Summary Reporter
      #
      # Similar to the Verbatim reporter, but does
      # not display test code for passing tests.

      class Summary < Reporter

        def report_header(step)
          puts ANSICode.bold(step.text)
        end

        def report_comment(step)
          txt = step.text.tabto(2)
          txt[0,1] = "*"
          puts txt 
        end

        def report_macro(step)
          txt = step.text.tabto(2)
          txt[0,1] = "*"
          puts txt 
          #puts
          #puts ANSICode.magenta("#{step.code}")
        end

        def report_pass(step)
          #puts ANSICode.green("#{step.code}")
        end

        def report_fail(step, assertion)
          msg = ''
          msg << "  ##### FAIL #####\n"
          msg << "  # " + assertion.to_s
          msg = ANSICode.magenta(msg)
          puts msg
          #puts
          puts ANSICode.red("#{step.code}")
        end

        def report_error(step, exception)
          raise exception if $DEBUG
          msg = ''
          msg << "  ##### ERROR #####\n"
          msg << "  # " + exception.to_s + "\n"
          msg << "  # " + exception.backtrace[0]
          msg = ANSICode.magenta(msg)
          puts msg
          #puts
          puts ANSICode.red("#{step.code}")
        end

        #def report(str)
        #  count[-1] += 1 unless count.empty?
        #  str = str.chomp('.') + '.'
        #  str = count.join('.') + ' ' + str
        #  puts str.strip
        #end

      end #class Summary

    end #class Reporter

  end #module Spec

end #module Quarry

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
quarry-0.4.0 lib/quarry/spec/reporter/summary.rb