[Rt-commit] r8313 - rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT

ruz at bestpractical.com ruz at bestpractical.com
Mon Jul 30 11:50:59 EDT 2007


Author: ruz
Date: Mon Jul 30 11:50:59 2007
New Revision: 8313

Modified:
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Test.pm

Log:
* allow to add additions into the config, however that require importing of
  RT::Test all the time, but we can live with that

Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Test.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Test.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Test.pm	Mon Jul 30 11:50:59 2007
@@ -20,6 +20,20 @@
     else {
         $port = 11229;
     }
+};
+
+use RT::Interface::Web::Standalone;
+use Test::HTTP::Server::Simple;
+use Test::WWW::Mechanize;
+
+unshift @RT::Interface::Web::Standalone::ISA, 'Test::HTTP::Server::Simple';
+
+my @server;
+
+sub import {
+    my $class = shift;
+    my %args = @_;
+
     $config = File::Temp->new;
     print $config qq{
 Set( \$WebPort , $port);
@@ -27,10 +41,11 @@
 Set( \$DatabaseName , "rt3test");
 Set( \$LogToSyslog , undef);
 Set( \$LogToScreen , "warning");
-1;
 };
+    print $config $args{'config'} if $args{'config'};
+    print $config "\n1;\n";
+    $ENV{'RT_SITE_CONFIG'} = $config->filename;
     close $config;
-    $ENV{RT_SITE_CONFIG} = $config->filename;
 
     use RT;
     RT::LoadConfig;
@@ -44,19 +59,6 @@
         return 1;
     };
     RT::Config->Set( 'MailCommand' => $mailfunc);
-};
-
-use RT::Interface::Web::Standalone;
-use Test::HTTP::Server::Simple;
-use Test::WWW::Mechanize;
-
-unshift @RT::Interface::Web::Standalone::ISA, 'Test::HTTP::Server::Simple';
-
-my @server;
-
-sub import {
-    my $class = shift;
-    my %args = @_;
 
     require RT::Handle;
     unless ( $existing_server ) {


More information about the Rt-commit mailing list