Subject: | Doc patch |
Documents the fact that the CATALYST_SERVER environment variable works
with this module and briefly explains how to use it.
I'm afraid the patch is against version 0.36, but hopefully that won't
cause too much hassle.
Subject: | TWMC.diff |
--- Catalyst.pm 2006-11-08 14:37:55.000000000 +1100
+++ Catalyst.pm_mine 2006-11-08 14:47:18.000000000 +1100
@@ -101,7 +101,20 @@
applications but does not start a server or issue HTTP
requests. Instead, it passes the HTTP request object directly to
L<Catalyst>. Thus you do not need to use a real hostname:
-"http://localhost/" will do.
+"http://localhost/" will do. However, this is optional. The following
+two lines of code do exactly the same thing:
+
+ $mech->get_ok('/action');
+ $mech->get_ok('http://localhost/action');
+
+You can also test a remote server by setting the environment variable
+CATALYST_SERVER, for example:
+
+ $ CATALYST_SERVER=http://example.com/myapp prove -l t
+
+will run the same tests on the application running at
+http://example.com/myapp regardless of whether or not you specify
+http:://localhost for Test::WWW::Mechanize::Catalyst.
This makes testing fast and easy. L<Test::WWW::Mechanize> provides
functions for common web testing scenarios. For example: