Class: Test::Unit::TestSuite

Inherits:
Object
  • Object
show all
Defined in:
lib/test/spec.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#positionObject



453
454
455
# File 'lib/test/spec.rb', line 453

def position
  @tests.first.respond_to?(:position) ? @tests.first.position : 0
end

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

Yields:

  • (STARTED, name)


438
439
440
441
442
443
444
445
# File 'lib/test/spec.rb', line 438

def run(result, &progress_block)
  sort!
  yield(STARTED, name)
  @tests.each do |test|
    test.run(result, &progress_block)
  end
  yield(FINISHED, name)
end

#sort!Object



447
448
449
450
451
# File 'lib/test/spec.rb', line 447

def sort!
  @tests = @tests.sort_by { |test|
    test.respond_to?(:position) ? test.position : 0
  }
end