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

Methods

add_suite   filter=   include?   new   sort  

Classes and Modules

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

Public Class methods

[Source]

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

Public Instance methods

[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

[Source]

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

[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

[Source]

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

[Validate]

ruby-doc.org is hosted and maintained by James Britt and Neurogami, LLC, a Ruby consulting company. The site was created in 2002 as part of the Ruby Documentation Project to promote the Ruby language and to help other Ruby hackers.

Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.

For more information on the Ruby programming language, visit ruby-lang.org.

For information about this site or Neurogami, contact james@neurogami.com.