[hunchentoot-devel] Unit testing Hunchentoot websites

Slava Akhmechet coffeemug at gmail.com
Sun Apr 15 18:54:57 UTC 2007


Vamsee Kanakala <vamlists at gmail.com> writes:

> I had a similar problem, and I guess my not very elegant solution was to
> create a dummy-request class, which basically has the same slots as that
> of hunchentoot::request, and you can set parameters like so, and set the
> dummy request instance to *request*:
Thanks! This is essentially what I wanted to do but you handed it to
me on a silver platter :) One question though, why do you create a
dummy-request class instead of using hunchentoot's? You could also
derive something like unittest-request if you need some special
functionality.

> I found out that setting some vars like hunchentoot::*session-secret*
> properly and doing a start-session lets you use session within a test
> happily.
Would it make sense to add some functions to Hunchentoot that would
provide a public API to do this? This way everyone can unit-test
Hunchentoot apps in the same standard way.

-- 
Regards,
Slava Akhmechet.



More information about the Tbnl-devel mailing list