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


in reply to Re: RFC: Systemizing CGI upload testing
in thread RFC: Systemizing CGI upload testing

No. Test::MockObject is essential if you are trying to achieve complete test coverage of a module - for example where you are trying to simulate unusual behaviour such as database queries failing for no particular reason. Rather the behaviour I am seeking to simulate is the normal behaviour of web server when processing a POST request - without actually running a web server.
  • Comment on Re^2: RFC: Systemizing CGI upload testing

Replies are listed 'Best First'.
Re^3: RFC: Systemizing CGI upload testing
by GrandFather (Saint) on Jun 24, 2010 at 11:28 UTC

    But doesn't that come to much the same thing? I use MockObject most often to mock MIME::Lite so that the code I'm testing thinks it is doing business as usual, but I can capture and print locally the email that would have been sent - not unlike your non-running web server really.

    True laziness is hard work
      That is a really cool and very practical use of Test:MockObject. However I don't think the analogy holds because I want the whole environment to be real and not fake: real environment variables, real input and a real CGI or equivalent object. Have a look at the CGI test script I cited. That is really what I want to do - but it depends on an input file that is not in a strictly human readable format. So essentially what I want to do is make that input file maintainable by humans.