[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Q: How not to run TestCase

Tomoyuki Kosimizu

10/17/2004 3:43:00 PM

3 Answers

gabriele renzi

10/17/2004 7:13:00 PM

0

Tomoyuki Kosimizu ha scritto:
> Hi,
>
> I have code like this:
>
> class SuperTestCase << Test::Unit::TestCase
> def test_doit
> assert_equal('a', get_a)
> end
>
> def get_a
> raise 'subclass responsibility'
> end
> end
>
> class SubATest < SuperTestCase
> def get_a
> return 'a'
> end
> end
>
> class SubBTest < SuperTestCase
> def get_a
> return ?a.chr
> end
> end
>
> Of course, I can not use test/unit.rb. But I don't know other way to
> run this. Would you tell me how not to run SuperTestCase?

well, you could have it in a module and include it via mixin. Another
way may be to write your own test suite. Just my two cents.

Jim Weirich

10/17/2004 7:46:00 PM

0

gabriele renzi wrote:
> Tomoyuki Kosimizu ha scritto:
[... example of parent test case elided ...]
>> Of course, I can not use test/unit.rb. But I don't know other way to
>> run this. Would you tell me how not to run SuperTestCase?
>
> well, you could have it in a module and include it via mixin. Another
> way may be to write your own test suite. Just my two cents.

Putting common test methods in a mixin module has worked well for me.

--
-- Jim Weirich jim@weirichhouse.org http://onest...
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)


Nathaniel Talbott

10/20/2004 1:13:00 PM

0

On Oct 17, 2004, at 15:46, Jim Weirich wrote:

> Putting common test methods in a mixin module has worked well for me.

That would be my suggestion as well.


Nathaniel
Terralien, Inc.

<:((><