From: Matt Armstrong Date: 2002-03-30T06:05:16+09:00 Subject: Re: RUNIT: mixin instead of inheriting? ptkwt@shell1.aracnet.com (Phil Tomson) writes: > I'm wondering if it's possible (or if it could be acheived without > too much change to RUNIT) to mixin functionality from > RUNIT::TestCase into a class instead of inheriting: > > Currently we have to do: > > class TestingMyDesign < RUNIT::TestCase > .... > def test_MyDesign > ... > end > end > > I would like to be able to do: > > class MyDesign < Design #I have a class to inherit from already > include RUNIT::TestCase > .... > def test_MyDesign > ... > end > end > > md = MyDesign.new() > .... > > md.run_suite > > Would it make sense? It might even work, but then the class you're testing would actually be a test class. Unit tests are supposed to use the objects they are testing in a similar way a programmer would. Actually making the class being tested a unit test seems odd. What is your motivation for wanting to do this? -- matt