Allow routing tests to bypass loading DW::Controller subclasses.

        Patch by exor674. 

diffs (28 lines):

diff -r a7e8f71fcb4c -r 6c296a523b4e cgi-bin/DW/Routing.pm
--- a/cgi-bin/DW/Routing.pm     Wed Jul 14 22:50:18 2010 -0500
+++ b/cgi-bin/DW/Routing.pm     Fri Jul 16 22:45:32 2010 -0500
@@ -37,8 +37,8 @@ my $default_content_types = {
     'plain' => "text/plain; charset=utf-8",
 };
 
-LJ::ModuleLoader->require_subclasses( "DW::Controller" );
-LJ::ModuleLoader->require_subclasses( "DW::Controller::Interface" );
+LJ::ModuleLoader->require_subclasses( "DW::Controller" )
+    unless $DW::Routing::DONT_LOAD;  # for testing
 
 =head1 NAME
 
diff -r a7e8f71fcb4c -r 6c296a523b4e t/routing.t
--- a/t/routing.t       Wed Jul 14 22:50:18 2010 -0500
+++ b/t/routing.t       Fri Jul 16 22:45:32 2010 -0500
@@ -2,6 +2,10 @@ use strict;
 use strict;
 use Test::More tests => 174;
 use lib "$ENV{LJHOME}/cgi-bin";
+
+# don't let DW::Routing load DW::Controller subclasses
+$DW::Routing::DONT_LOAD = 1;
+
 require 'ljlib.pl';
 use DW::Request::Standard;
 use HTTP::Request;
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to