Class: Turn::DotReporter

### Home Classes Methods

### In Files

- lib/turn/reporters/dot_reporter.rb

### Parent

Turn::Reporter

### Methods

- #error
- #fail
- #finish_case
- #finish_suite
- #finish_test
- #pass
- #skip
- #start_case
- #start_suite
- #start_test

### Files

- History.txt
- LICENSE-GPL2.txt
- LICENSE-MIT.txt
- LICENSE-RUBY.txt
- LICENSE.txt
- Release.txt
- Version.txt

### Class/Module Index

Quicksearch

- Turn
- Turn::Colorize
- Turn::Command
- Turn::Configuration
- Turn::Controller
- Turn::CrossRunner
- Turn::CueReporter
- Turn::DotReporter
- Turn::IsoRunner
- Turn::MarshalReporter
- Turn::MiniRunner
- Turn::OutlineReporter
- Turn::PrettyReporter
- Turn::ProgressReporter
- Turn::Reporter
- Turn::SoloRunner
- Turn::TestCase
- Turn::TestMethod
- Turn::TestRunner
- Turn::TestSuite
- Test
- Test::Unit
- Test::Unit::Failure
- Object
- String

No matching classes.

# Turn::DotReporter

# Traditional Dot Reporter

### Public Instance Methods

error(exception, message=nil) click to toggle source

    # File lib/turn/reporters/dot_reporter.rb, line 29
    def error(exception, message=nil)
      io.print Colorize.error('E'); io.flush
    end

fail(assertion, message=nil) click to toggle source

    # File lib/turn/reporters/dot_reporter.rb, line 25
    def fail(assertion, message=nil)
      io.print Colorize.fail('F'); io.flush
    end

finish_case(kase) click to toggle source

    # File lib/turn/reporters/dot_reporter.rb, line 40
    def finish_case(kase)
    end

finish_suite(suite) click to toggle source

    # File lib/turn/reporters/dot_reporter.rb, line 43
    def finish_suite(suite)
      io.puts("\nFinished in %.5f seconds." % [Time.now - @time])

      report = ''

      list = []
      suite.each do |testcase|
        testcase.each do |testunit|
          if testunit.fail? || testunit.error?
            list << testunit
          end
        end
      end

      unless list.empty? # or verbose?
        #report << "\n\n-- Failures and Errors --\n\n"
        list.uniq.each do |testunit|
          message = []
          message << (testunit.fail? ? FAIL : ERROR)
          message << testunit.message.tabto(2)
          message << clean_backtrace(testunit.backtrace).join("\n").tabto(2)
          report << "\n" << message.join("\n") << "\n"
        end
        report << "\n"
      end

      io.puts report

      # @TODO: Add something like suite.count(:tests, :passes) or
      #        suite.count(tests: "%d tests", passes: "%d passes")
      #        to cleanup, which will return something handy
      #        (suite.count(:test, :passes).test proxy maybe?)
      total      = "%d tests" % suite.count_tests
      passes     = "%d passed" % suite.count_passes
      assertions = "%d assertions" % suite.count_assertions
      failures   = "%s failures" % suite.count_failures
      errors     = "%s errors" % suite.count_errors
      skips      = "%s skips" % suite.count_skips

      tally = [total, passes, assertions, failures, errors, skips].join(", ")

      io.puts suite.passed? ? Colorize.green(tally) : Colorize.red(tally)
    end

finish_test(test) click to toggle source

    # File lib/turn/reporters/dot_reporter.rb, line 37
    def finish_test(test)
    end

pass(message=nil) click to toggle source

    # File lib/turn/reporters/dot_reporter.rb, line 21
    def pass(message=nil)
      io.print Colorize.pass('.'); io.flush
    end

skip(exception, message=nil) click to toggle source

    # File lib/turn/reporters/dot_reporter.rb, line 33
    def skip(exception, message=nil)
      io.print Colorize.skip('S'); io.flush
    end

start_case(kase) click to toggle source

    # File lib/turn/reporters/dot_reporter.rb, line 15
    def start_case(kase)
    end

start_suite(suite) click to toggle source

    # File lib/turn/reporters/dot_reporter.rb, line 9
    def start_suite(suite)
      @time = Time.now
      io.puts "Loaded suite #{suite.name}"
      io.puts "Started"
    end

start_test(test) click to toggle source

    # File lib/turn/reporters/dot_reporter.rb, line 18
    def start_test(test)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.