<br><br><div class="gmail_quote">On Sat, Dec 11, 2010 at 7:00 AM,  <span dir="ltr">&lt;<a href="mailto:canberra-pm-request@pm.org">canberra-pm-request@pm.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Send Canberra-pm mailing list submissions to<br>
        <a href="mailto:canberra-pm@pm.org">canberra-pm@pm.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://mail.pm.org/mailman/listinfo/canberra-pm" target="_blank">http://mail.pm.org/mailman/listinfo/canberra-pm</a><br>
or, via email, send a message with subject or body &#39;help&#39; to<br>
        <a href="mailto:canberra-pm-request@pm.org">canberra-pm-request@pm.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:canberra-pm-owner@pm.org">canberra-pm-owner@pm.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of Canberra-pm digest...&quot;<br>
<br>
<br>
Today&#39;s Topics:<br>
<br>
   1. Testing HTML::Mason web application workflows (Alex Satrapa)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Fri, 10 Dec 2010 12:11:48 +1100<br>
From: Alex Satrapa &lt;<a href="mailto:grail@goldweb.com.au">grail@goldweb.com.au</a>&gt;<br>
Subject: [Canberra-pm] Testing HTML::Mason web application workflows<br>
To: <a href="mailto:canberra-pm@pm.org">canberra-pm@pm.org</a><br>
Message-ID: &lt;<a href="mailto:B8FE850D-A84F-4B0A-BAAB-FB97847A00F4@goldweb.com.au">B8FE850D-A84F-4B0A-BAAB-FB97847A00F4@goldweb.com.au</a>&gt;<br>
Content-Type: text/plain; charset=us-ascii<br>
<br>
Dear Mongers,<br>
<br>
I&#39;m currently playing around with HTML::Mason::Test which lets me test individual templates in what are effectively unit tests.<br>
<br>
My Google-fu is obviously weak, I cannot find anything about integration/workflow testing.<br>
<br>
On one hand, I could use Test::WWW::Mechanize. The catch with this approach is that I&#39;ll need to set up a web server - not something I really want to do in my test suite since I don&#39;t want to have &quot;install Apache&quot;</blockquote>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> as a prerequisite for being able to develop the application (the developer might have a fondness for some other web server).<br>

</blockquote><div><br></div><div>You may want to consider PSGI (Plack). It comes with a Perl webserver out of the box for testing, is web-server agnostic, and is generally a great environment to develop web apps in. There is an adapter for HTML::Mason:</div>

<div><a href="http://search.cpan.org/~abh/HTML-Mason-PSGIHandler-0.52/lib/HTML/Mason/PSGIHandler.pm">http://search.cpan.org/~abh/HTML-Mason-PSGIHandler-0.52/lib/HTML/Mason/PSGIHandler.pm</a></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">


<br>
Under Ruby on Rails and Django, the test suites provide the ability to mimic HTTP calls, instead invoking the template engine directly. In the test suite I can instruct the test engine to fill in certain fields with certain values, &quot;submit&quot; that form to the mock HTTP service (which is just a shim covering the Rails or Django libraries), with no need to set up an actual web server launching CGI scripts or WSGI or what not.<br>


<br>
My current test suites run in the order of 15 seconds for 403 tests. I want to avoid network or disk operations where at all possible.<br>
<br>
Is such an environment available for testing HTML::Mason applications? I&#39;d like this to be pure Perl as far as possible.<br></blockquote><div><br></div><div>I believe Plack::Test allows for this when using the MockHTTP backend:</div>

<div><a href="http://search.cpan.org/~miyagawa/Plack-0.9956/lib/Plack/Test.pm">http://search.cpan.org/~miyagawa/Plack-0.9956/lib/Plack/Test.pm</a></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">


<br>
Alex<br>
<br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
Canberra-pm mailing list<br>
<a href="mailto:Canberra-pm@pm.org">Canberra-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/canberra-pm" target="_blank">http://mail.pm.org/mailman/listinfo/canberra-pm</a><br>
<br>
End of Canberra-pm Digest, Vol 63, Issue 1<br>
******************************************<br>
</blockquote></div><br>