[hunchentoot-devel] Unit testing Hunchentoot websites

Slava Akhmechet coffeemug at gmail.com
Sat Apr 14 23:47:37 UTC 2007


I'm building a web framework on top of Hunchentoot and I ran into
problems while trying to unit test some of my code. Essentially I need
to unit test behavior that happens accross requests. I want to do it
without starting Hunchentoot by faking the necessary objects (request,
session, etc.)

The documentation says the usual special variables passed to handlers
contain opaque objects. Hunchentoot provides no means of instantiating
them manually (unless I get into internal code, which will tie me to
the implementation). I see two possible solutions:

1. Abstract my code away from Hunchentoot objects. This way I can fake
the necessary environment during unit testing and use Hunchentoot's
environment during the real thing.

2. Create my own objects and make sure all appropriate symbols are
defined for them - essentially faking Huchentoot's API.

It seems like the first option is a better one, but I feel like
Huchentoot should provide some support for this. I'd be happy to hack
it in if I get some direction (as I'm new to Hunchentoot and CL in
general).

-- 
Regards,
Slava Akhmechet.



More information about the Tbnl-devel mailing list