Class: Test::Unit::Collector::Descendant

Inherits:
Object
  • Object
show all
Includes:
Test::Unit::Collector
Defined in:
lib/test/unit/collector/descendant.rb

Constant Summary collapse

NAME =
'collected from the subclasses of TestCase'

Instance Method Summary collapse

Methods included from Test::Unit::Collector

#add_suite, #filter=, #include?, #initialize, #sort

Instance Method Details

#collect(name = NAME) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/test/unit/collector/descendant.rb', line 11

def collect(name=NAME)
  suite = TestSuite.new(name)
  sub_suites = []
  TestCase::DESCENDANTS.each do |descendant_test_case|
    add_suite(sub_suites, descendant_test_case.suite)
  end
  sort(sub_suites).each {|s| suite << s}
  suite
end