Does anybody know how to test a plugin module that looks like the one below? It's designed to be included by a controller, typically the application controller.
My specific questions are:
- Can I get at my do_before and do_after methods from a unit test to probe them individually?
- How can I set up a fake request into which I can stuff various values for the HTTP_REFERER header?
- How can I then get an appropriate fake reponse?
Also, is using a class variable the correct way to hold my_data?
@@my_data = 
@@my_data << %w( foo bar baz )
# do stuff, using my @@data
# do stuff with response.body
I have tried mangling a functional test and also looked at various plugins from the usual suspects[1-3] but the penny still hasn't dropped.
Thanks and regards,