http://www.perlmonks.org?node_id=945798


in reply to Localhost network interaction in tests

I wrote a HTTP server module for testing HTTP clients. My advice is to just avoid the HTTP transfer and use file:// URIs to fetch a canned copy of a known good page from disk instead.

If you really, really want to embark on doing a full end-to-end test with a HTTP server that serves a canned copy of the modem pages, have a look at Test::HTTP::LocalServer, which provides a set of canned responses and can easily be extended to serve canned files as well. But still, it is far easier to substitute the base URI for accessing the modem to be a file:// URI instead.