From: Samuel Tesla Date: 2003-07-05T22:45:12+09:00 Subject: Re: Unit Testing HTTP cookie handling Chad Fowler writes: > One thing you can do is to setup the code which you're unit testing to > accept a cgi object as a parameter. Then, in your tests you can > instantiate a CGI object, put the cookies you want into it and then hand > it off to the code that you're testing. Of course, if all that code > does is handle cookies, you don't even need a CGI object. You can pass > in any object that responds to "cookies" with a Hash-like thing. Ruby > is nice for doing mock objects, since all you have to do is respond to > the right messages (but not worry about object type). I was thinking about doing that. What I've settled on, though, is using WebUnit. Since I'm actually writing a full out CGI app, and WebUnit looks pretty nice. Thanks, Samuel