On Fri, 2006-03-24 at 05:37 +0900, David Solis wrote:
> Hello,
> 
> I'm having difficulty understanding inheritance in this case. In the 
> program below, I'm inheriting from <Test::Unit::TestCase. I also want my 
> other class in this program to inherit from <Test::Unit::TestCase. My 
> goal is to be able to make assertions in both classes.

If all you want to do is make assertions, you could try something like:

require 'test/unit/assertions'

class MyClass
  include Test::Unit::Assertions

  def something(something_else)
    assert_equal 2, something_else.length
  end
end

Subclassing Test::Unit::TestCase will rarely work out well since I
believe Test::Unit automatically collects testcases and runs them before
ruby quits.

-- 
Ross Bamford - rosco / roscopeco.REMOVE.co.uk