From: Jim Weirich Date: 2006-05-23T05:36:31+09:00 Subject: Re: Test::Unit Patch that allows test methods to be executed Ryan Davis wrote: > On May 21, 2006, at 7:45 PM, bpettichord@gmail.com wrote: > >> proper unit testing. > Why not subclass TestCase and create SequentialTestCase or > WatirTestCase? The problem with subclassing is that it doesn't combine well with other potential Test::Unit add-ins. (For that matter, I suspect the patch way doesn't combine well either, but I haven't looked at the details). For example, I have a Test::Unit::TestCase mod that allows FlexMock objects to be automatically verified at the end of a test case. If I make this a sub-class, then Brett can't use my FlexMock subclass with his Watir subclass. Rather, make the add-ins modules, then the user can mix-in whatever behavior they need. For example ... class MyTest < Test::Unit::TestCase include FlexMock::TestCase include Watir::TestCase def test_using_both_watir_and_flexmock_extensions ... end end Now, the flexmock one ties in by overriding teardown, so any user supplied setup/teardown methods should carefully invoke super (which they probably should do anyways). -- Jim Weirich -- Posted via http://www.ruby-forum.com/.