Parent

CI::Reporter::TestUnit

Replacement Mediator that adds listeners to capture the results of the Test::Unit runs.

Public Class Methods

new(suite, report_mgr = nil) click to toggle source
# File lib/ci/reporter/test_unit.rb, line 84
def initialize(suite, report_mgr = nil)
  super(suite)
  @report_manager = report_mgr || ReportManager.new("test")
  add_listener(Test::Unit::UI::TestRunnerMediator::STARTED, &method(:started))
  add_listener(Test::Unit::TestCase::STARTED, &method(:test_started))
  add_listener(Test::Unit::TestCase::FINISHED, &method(:test_finished))
  add_listener(Test::Unit::TestResult::FAULT, &method(:fault))
  add_listener(Test::Unit::UI::TestRunnerMediator::FINISHED, &method(:finished))
end

Public Instance Methods

fault(fault) click to toggle source
# File lib/ci/reporter/test_unit.rb, line 115
def fault(fault)
  tc = @current_suite.testcases.last
  tc.failures << Failure.new(fault)
end
finished(elapsed_time) click to toggle source
# File lib/ci/reporter/test_unit.rb, line 120
def finished(elapsed_time)
  finish_suite
end
started(result) click to toggle source
# File lib/ci/reporter/test_unit.rb, line 94
def started(result)
  @suite_result = result
  @last_assertion_count = 0
  @current_suite = nil
  @unknown_count = 0
  @result_assertion_count = 0
end
test_finished(name) click to toggle source
# File lib/ci/reporter/test_unit.rb, line 111
def test_finished(name)
  finish_test
end
test_started(name) click to toggle source
# File lib/ci/reporter/test_unit.rb, line 102
def test_started(name)
  test_name, suite_name = extract_names(name)
  unless @current_suite && @current_suite.name == suite_name
    finish_suite
    start_suite(suite_name)
  end
  start_test(test_name)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.