Module | Test::Unit::Collector
In: | test/unit/collector.rb test/unit/collector/objectspace.rb test/unit/collector/dir.rb

### Methods

add_suite filter= include? new sort

### Classes and Modules

Class Test::Unit::Collector::Dir
Class Test::Unit::Collector::ObjectSpace

### Public Class methods

new()

[Source]

    # File test/unit/collector.rb, line 4
          def initialize
            @filters = []
          end

### Public Instance methods

add_suite(destination, suite)

[Source]

    # File test/unit/collector.rb, line 17
          def add_suite(destination, suite)
            to_delete = suite.tests.find_all{|t| !include?(t)}
            to_delete.each{|t| suite.delete(t)}
            destination << suite unless(suite.size == 0)
          end

filter=(filters)

[Source]

    # File test/unit/collector.rb, line 8
          def filter=(filters)
            @filters = case(filters)
              when Proc
                [filters]
              when Array
                filters
            end
          end

include?(test)

[Source]

    # File test/unit/collector.rb, line 23
          def include?(test)
            return true if(@filters.empty?)
            @filters.each do |filter|
              result = filter[test]
              if(result.nil?)
                next
              elsif(!result)
                return false
              else
                return true
              end
            end
            true
          end

sort(suites)

[Source]

    # File test/unit/collector.rb, line 38
          def sort(suites)
            suites.sort_by{|s| s.name}
          end

[Validate]