Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Q: How not to run TestCase

Reply
Thread Tools

Q: How not to run TestCase

 
 
Tomoyuki Kosimizu
Guest
Posts: n/a
 
      10-17-2004
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?

http://www.velocityreviews.com/forums/(E-Mail Removed)-net.ne.jp


 
Reply With Quote
 
 
 
 
gabriele renzi
Guest
Posts: n/a
 
      10-17-2004
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.
 
Reply With Quote
 
 
 
 
Jim Weirich
Guest
Posts: n/a
 
      10-17-2004
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 http://www.velocityreviews.com/forums/(E-Mail Removed) http://onestepback.org
-----------------------------------------------------------------
"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)


 
Reply With Quote
 
Nathaniel Talbott
Guest
Posts: n/a
 
      10-20-2004
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.

<(><



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Junit3 error: Implicit super constructor TestCase() is not visible albert kao Java 1 01-21-2011 12:35 PM
Want to call a method only once for unittest.TestCase--but not surehow? Oltmans Python 1 09-28-2009 12:40 PM
a testcase writen by watij base on java can not be used in JSP davy Java 4 06-13-2007 10:14 AM
Differerence between Test::Unit::TestCase and RUNIT::TestCase Scott Ruby 1 08-20-2005 08:49 PM



Advertisments