[pm-h] LWP testing module

G. Wade Johnson gwadej at anomaly.org
Thu Aug 11 20:17:49 PDT 2011


After the meeting tonight, Gordon asked about testing a module that
would call out to an HTTP server as part of the testing. This is
difficult, because there may be no server running on a client's
machine. (In Gordon's case, it actually needed to be a Selenium server.
So this is even less likely.

I remembered hearing about the LSP::Protocol::PSGI module during a
conversation at YAPC::NA this year.
(https://metacpan.org/module/LWP::Protocol::PSGI)

This module hijacks the LWP internals and directs them to a PSGI server
you set up in the test code. Your code can make calls through LWP just
like you are talking to a real server, but internal code supplies
response through a PSGI interface.

I was hoping to get some time to look into it, but I haven't yet.
Hopefully someone else will get the chance.

G. Wade
-- 
Contrary to popular opinion, the plural of 'anecdote' is not 'fact'.


More information about the Houston mailing list