I'm not sure I understand how this improve on mocking/wrapping LWP::UserAgent::request(). I still need to inject the mock response to a request to HTTP::Server::Simple -- and this adds an extra layer of complexity. Is there some sample code you could point me to?
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
For my tests of WWW::Mechanize::Shell, I wrote me Test::HTTP::LocalServer,
which allows me to test simple interaction by providing canned responses and logging the incoming requests and outgoing responses.
Depending on what you want to do, this might be sufficient for your needs, as all higher-level interaction can be faked by mocking LWP::UserAgent::request I guess.