In Files

  • test/unit/collector.rb
  • test/unit/collector/dir.rb
  • test/unit/collector/objectspace.rb

Test::Unit::Collector

Public Class Methods

new() click to toggle source
 
               # File test/unit/collector.rb, line 4
def initialize
  @filters = []
end
            

Public Instance Methods

add_suite(destination, suite) click to toggle 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) click to toggle source
 
               # File test/unit/collector.rb, line 8
def filter=(filters)
  @filters = case(filters)
    when Proc
      [filters]
    when Array
      filters
  end
end
            
include?(test) click to toggle 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) click to toggle source
 
               # File test/unit/collector.rb, line 38
def sort(suites)
  suites.sort_by{|s| s.name}
end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus