Class: Test::Unit::TestSuite

Inherits:
Object
  • Object
show all
Defined in:
lib/tu-context/suite.rb

Instance Method Summary collapse

Instance Method Details

#run(result) {|STARTED, name| ... } ⇒ Object

Runs the tests and/or suites contained in this TestSuite.

Yields:

  • (STARTED, name)


27
28
29
30
31
32
33
34
35
36
# File 'lib/tu-context/suite.rb', line 27

def run(result, &progress_block) # :nodoc:
  yield(STARTED, name)
  ivars_from_callback = @tests.first.run_all_callbacks(:before) if @tests.first.is_a?(Test::Unit::TestCase)
  @tests.each do |test|
    test.set_values_from_callbacks(ivars_from_callback) if ivars_from_callback
    test.run(result, &progress_block)
  end
  ivars_from_callback = @tests.first.run_all_callbacks(:after) if ivars_from_callback
  yield(FINISHED, name)
end