123456789_123456789_123456789_123456789_123456789_

Class: Test::Unit::UI::TestRunner

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Inherits: Object
Defined in: lib/test/unit/ui/testrunner.rb

Class Method Summary

TestRunnerUtilities - Extended

run

Creates a new TestRunner and runs the suite.

start_command_line_test

Takes care of the ARGV parsing and suite determination necessary for running one of the TestRunners from the command line.

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(suite, options = {}) ⇒ TestRunner

[ GitHub ]

  
# File 'lib/test/unit/ui/testrunner.rb', line 10

def initialize(suite, options={})
  if suite.respond_to?(:suite)
    @suite = suite.suite
  else
    @suite = suite
  end
  @options = options
  @listeners = @options[:listeners] || []
end

Instance Attribute Details

#listeners (readonly)

[ GitHub ]

  
# File 'lib/test/unit/ui/testrunner.rb', line 9

attr_reader :listeners

Instance Method Details

#attach_listeners (private)

[ GitHub ]

  
# File 'lib/test/unit/ui/testrunner.rb', line 33

def attach_listeners
  @listeners.each do |listener|
    listener.attach_to_mediator(@mediator)
  end
end

#diff_target_string?(string) ⇒ Boolean (private)

[ GitHub ]

  
# File 'lib/test/unit/ui/testrunner.rb', line 43

def diff_target_string?(string)
  Assertions::AssertionMessage.diff_target_string?(string)
end

#prepare_for_diff(from, to) (private)

[ GitHub ]

  
# File 'lib/test/unit/ui/testrunner.rb', line 47

def prepare_for_diff(from, to)
  Assertions::AssertionMessage.prepare_for_diff(from, to)
end

#setup_mediator (private)

[ GitHub ]

  
# File 'lib/test/unit/ui/testrunner.rb', line 29

def setup_mediator
  @mediator = TestRunnerMediator.new(@suite, @options)
end

#start

Begins the test run.

[ GitHub ]

  
# File 'lib/test/unit/ui/testrunner.rb', line 21

def start
  setup_mediator
  attach_to_mediator
  attach_listeners
  start_mediator
end

#start_mediator (private)

[ GitHub ]

  
# File 'lib/test/unit/ui/testrunner.rb', line 39

def start_mediator
  @mediator.run
end