how to test a ruby class

D

doug.baker

------_=_NextPart_001_01C62E75.3B82899B
Content-Type: text/plain;
charset="iso-8859-1"
Hi: I just installed Ruby and have FreeRIDE open. In Ruby, is there a
method comparable to the "main" method in java that will run the class for
testing?
I would like to run my class from the IDE.

Thanks,
Doug
E-MAIL CONFIDENTIALITY NOTICE:
The contents of this e-mail message and any attachments are intended solely
for the addressee(s) and may contain confidential and/or legally privileged
information. If you are not the intended recipient of this message or if
this message has been addressed to you in error, please immediately alert
the sender by reply e-mail and then delete this message and any attachments.
If you are not the intended recipient, you are notified that any use,
dissemination, distribution, copying, or storage of this message or any
attachments is strictly prohibited.

------_=_NextPart_001_01C62E75.3B82899B--
 
D

David Vallner

D=C5=88a Piatok 10 Febru=C3=A1r 2006 20:08 (e-mail address removed) nap=C3=ADsa=
l:
My two cents follow: I can't stand the very sight of people making a script=
or=20
class executable for the sake of testing - main() methods and the like are=
=20
supposed to execute a standalone program, and that's that. If you want to=20
test, then do it properly, create a separate hierarchy of files with unit=20
tests. It's just as easy, if not easier to write, and you don't clutter you=
r=20
business logic with test code.

David Vallner
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top