An example:

require "Set"

class SetTest
  def self.inherited(cl)
    ( @test_classes ||=[] ) << cl
  end
  
  def self.all_tests(set)
    @test_classes.each do |cl|
      return false unless cl.new.match(set)
    end
    
    true
  end
end


class Test1 < SetTest
  def match(set)
    puts "Test: #{self.class.name}"
    true
  end
end

SetTest.all_tests( Set.new )

    robert