[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: Unit-Testing HTTP header output

Barry Shultz

9/28/2003 5:53:00 AM

Hi,

>Mocking CGI worked fine for unit testing the class's response to
>already set cookies. But, I'm finding myself at a loss as to a good
>way (short of capturing output and using regexes) to test that the
>class properly *sets* the cookies.
>

Whenever I develop any http server app, my unit tests include a mock http
client and I use it
to *really* know what the server (isapi, cgi, servlet) is sending back. I
don't see how you could
reliably measure the server output otherwise.

Just my 0.02,
Barry

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online
http://clinic.mcafee.com/clinic/ibuy/campaign.as...


1 Answer

Samuel Tesla

9/28/2003 4:56:00 PM

0

"Barry Shultz" <barry_sh@hotmail.com> writes:
> Whenever I develop any http server app, my unit tests include a mock http
> client and I use it
> to *really* know what the server (isapi, cgi, servlet) is sending back. I
> don''t see how you could
> reliably measure the server output otherwise.

Yeah, I just want to try and set it up so I don''t have to depend on a
webserver being there to run automated tests. Perhaps if I set up
something with webrick?

The other option I can think of is to redirect the output from the
script into the input on the HTTP client and avoid the HTTP server
altogether. How do you do it?