[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: Question about unit tests

Berger, Daniel

5/3/2005 8:01:00 PM

> -----Original Message-----
> From: Vincent Foley [mailto:vfoley@gmail.com]
> Sent: Tuesday, May 03, 2005 1:55 PM
> To: ruby-talk ML
> Subject: Question about unit tests
>
>
> Hello all,
>
> I'm writing a small LiveJournal client, and I have a question
> for the unit tests: how do I "manage" the password? To make
> sure that my login method works well, I must provide the
> password in the test file, but I'm not sure I'm quite
> comfortable with distributing my tests with that password.
> Does anyone have any experience in dealing with things like
> this? Do I just not distribute the tests?

You could test with your password, but distribute with a bogus password
and a big warning sticker that says "INSERT REAL PASSWORD HERE".

You could also raise an explicit error in the setup method that users
must comment out to bring even more attention to the fact that users
must set their password before running the test suite.

Another option is to use mock objects.

Dan