fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2011-02-22 09:44 am

[dw-free] Framework for JS unit tests

[commit: http://hg.dwscoalition.org/dw-free/rev/5cad96087a9a]

http://bugs.dwscoalition.org/show_bug.cgi?id=3524

Don't include in the routing table at all, if we're not a dev server.

Patch by [personal profile] fu.

Files modified:
  • cgi-bin/DW/Controller/Dev.pm
--------------------------------------------------------------------------------
diff -r 7987e36ba2a6 -r 5cad96087a9a cgi-bin/DW/Controller/Dev.pm
--- a/cgi-bin/DW/Controller/Dev.pm	Tue Feb 22 17:12:12 2011 +0800
+++ b/cgi-bin/DW/Controller/Dev.pm	Tue Feb 22 17:43:00 2011 +0800
@@ -7,7 +7,7 @@
 # Authors:
 #      Afuna <coder.dw@afunamatata.com>
 #
-# Copyright (c) 2010 by Dreamwidth Studios, LLC.
+# Copyright (c) 2010-2011 by Dreamwidth Studios, LLC.
 #
 # This program is free software; you may redistribute it and/or modify it under
 # the same terms as Perl itself. For a copy of the license, please reference
@@ -23,7 +23,8 @@ DW::Routing->register_static( '/dev/clas
 DW::Routing->register_static( '/dev/classes', 'dev/classes.tt', app => 1 );
 
 
-DW::Routing->register_regex( '/dev/tests/([^/]+)(?:/(.*))?', \&tests_handler, app => 1 );
+DW::Routing->register_regex( '/dev/tests/([^/]+)(?:/(.*))?', \&tests_handler, app => 1 )
+    if $LJ::IS_DEV_SERVER;
 
 sub tests_handler {
     my ( $opts ) = @_;
@@ -31,7 +32,6 @@ sub tests_handler {
     my $lib = $opts->subpatterns->[1] || "";
 
     my $r = DW::Request->get;
-    return $r->NOT_FOUND unless $LJ::IS_DEV_SERVER;
 
     # force a site scheme which only shows the bare content
     # but still prints out resources included using need_res
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org