# File test-unit-3.3.4/lib/test/unit/collector.rb, line 17 def add_suite(destination, suite) to_delete = suite.tests.find_all do |test| test.is_a?(TestCase) and !include?(test) end suite.delete_tests(to_delete) destination << suite unless suite.empty? end
# File test-unit-3.3.4/lib/test/unit/collector.rb, line 25 def add_test_cases(suite, test_cases) children_map = {} test_cases.each do |test_case| ancestor_classes = test_case.ancestors.find_all do |ancestor| ancestor.is_a?(Class) end parent = ancestor_classes[1] children_map[parent] ||= [] children_map[parent] << test_case end root_test_cases = children_map.keys - test_cases root_test_cases.each do |root_test_case| add_test_case(suite, root_test_case, children_map) end end
# File test-unit-3.3.4/lib/test/unit/collector.rb, line 8 def filter=(filters) @filters = case(filters) when Proc [filters] when Array filters end end