On Wed, 28 Feb 2001, Ron Jeffries wrote:

> I'm wanting to set up RubyUnit to automatically run all the suites of
> all the subclasses of RUNIT::TestCase, but there doesn't seem to be a
> way to get all subclasses of a class ... or I can't find it.
> 
> Is there? What is it? Or is there another way to get all the suites?

There isn't, but this'll do it:


class Object
	def self.inherited(subclass)
		if @subclasses
			@subclasses << subclass
		else
			@subclasses = [subclass]
		end
	end

	def self.subclasses
		@subclasses
	end
end