[Rt-commit] rt branch, new-config, updated. rt-3.8.8-598-gd83ac17

Shawn Moore sartak at bestpractical.com
Thu Aug 26 02:43:05 EDT 2010


The branch, new-config has been updated
       via  d83ac173b4994c78b82beab1de769c87d0739a76 (commit)
       via  ce828a4f23b6c0509bfebaa0487c5008a57f521b (commit)
      from  dad32ea0b32abfc989b098dbb56a0a2d5a3b4b09 (commit)

Summary of changes:
 lib/RT/Test.pm        |   41 ++++++++++++++++++++---------------------
 t/lifecycles/utils.pl |    4 ++--
 t/mail/gateway.t      |    2 +-
 3 files changed, 23 insertions(+), 24 deletions(-)

- Log -----------------------------------------------------------------
commit ce828a4f23b6c0509bfebaa0487c5008a57f521b
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Aug 26 02:39:29 2010 -0400

    Update RT::Test

diff --git a/lib/RT/Test.pm b/lib/RT/Test.pm
index 546dd48..9cccf91 100644
--- a/lib/RT/Test.pm
+++ b/lib/RT/Test.pm
@@ -227,19 +227,19 @@ sub bootstrap_config {
         or die "Couldn't open $tmp{'config'}{'RT'}: $!";
 
     print $config qq{
-Set( \$WebDomain, "localhost");
-Set( \$WebPort,   $port);
-Set( \$WebPath,   "");
-Set( \$RTAddressRegexp , qr/^bad_re_that_doesnt_match\$/);
+Set(WebDomain => "localhost");
+Set(WebPort   => $port);
+Set(WebPath   => "");
+Set(RTAddressRegexp => qr/^bad_re_that_doesnt_match\$/);
 };
     if ( $ENV{'RT_TEST_DB_SID'} ) { # oracle case
-        print $config "Set( \$DatabaseName , '$ENV{'RT_TEST_DB_SID'}' );\n";
-        print $config "Set( \$DatabaseUser , '$dbname');\n";
+        print $config "Set(DatabaseName => '$ENV{'RT_TEST_DB_SID'}' );\n";
+        print $config "Set(DatabaseUser => '$dbname');\n";
     } else {
-        print $config "Set( \$DatabaseName , '$dbname');\n";
-        print $config "Set( \$DatabaseUser , 'u${dbname}');\n";
+        print $config "Set(DatabaseName => '$dbname');\n";
+        print $config "Set(DatabaseUser => 'u${dbname}');\n";
     }
-    print $config "Set( \$DevelMode, 0 );\n"
+    print $config "Set(DevelMode => 0 );\n"
         if $INC{'Devel/Cover.pm'};
 
     $self->bootstrap_logging( $config );
@@ -249,7 +249,7 @@ Set( \$RTAddressRegexp , qr/^bad_re_that_doesnt_match\$/);
         $tmp{'directory'}->dirname, 'mailbox.eml'
     );
     print $config <<END;
-Set( \$MailCommand, sub {
+Set(MailCommand => sub {
     my \$MIME = shift;
 
     open my \$handle, '>>', '$mail_catcher'
@@ -285,11 +285,11 @@ sub bootstrap_logging {
     chmod 0666, $tmp{'log'}{'RT'};
 
     print $config <<END;
-Set( \$LogToSyslog , undef);
-Set( \$LogToScreen , "warning");
-Set( \$LogToFile, 'debug' );
-Set( \$LogDir, q{$tmp{'directory'}} );
-Set( \$LogToFileNamed, 'rt.debug.log' );
+Set(LogToSyslog    => undef);
+Set(LogToScreen    => "warning");
+Set(LogToFile      => 'debug' );
+Set(LogDir         => q{$tmp{'directory'}} );
+Set(LogToFileNamed => 'rt.debug.log' );
 END
 }
 
@@ -303,19 +303,18 @@ sub set_config_wrapper {
         if ( ($caller[1]||'') =~ /\.t$/ ) {
             my ($self, $name) = @_;
             my $type = $RT::Config::META{$name}->{'Type'} || 'SCALAR';
-            my %sigils = (
-                HASH   => '%',
-                ARRAY  => '@',
-                SCALAR => '$',
+            my %function = (
+                HASH   => 'Hash',
+                ARRAY  => 'Array',
             );
-            my $sigil = $sigils{$type} || $sigils{'SCALAR'};
+            my $function = $function{$type} || '';
             open my $fh, '>>', $tmp{'config'}{'RT'}
                 or die "Couldn't open config file: $!";
             require Data::Dumper;
             my $dump = Data::Dumper::Dumper([@_[2 .. $#_]]);
             $dump =~ s/;\s+$//;
             print $fh
-                "\nSet(${sigil}${name}, \@{". $dump ."}); 1;\n";
+                "\nSet$function(${name} => \@{". $dump ."}); 1;\n";
             close $fh;
 
             if ( @SERVERS ) {

commit d83ac173b4994c78b82beab1de769c87d0739a76
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Aug 26 02:45:32 2010 -0400

    Fix up some test config

diff --git a/t/lifecycles/utils.pl b/t/lifecycles/utils.pl
index 21abeb2..83cb266 100644
--- a/t/lifecycles/utils.pl
+++ b/t/lifecycles/utils.pl
@@ -7,7 +7,7 @@ use warnings;
 my $config;
 BEGIN {
 $config = <<END;
-Set(\%Lifecycles,
+SetHash(Lifecycles =>
     default => {
         default_initial => 'new',
         initial  => [qw(new open resolved )],
@@ -58,7 +58,7 @@ Set(\%Lifecycles,
         },
     },
 );
-Set(\%LifecycleMap, delivery => 'delivery');
+SetHash(LifecycleMap => delivery => 'delivery');
 END
 }
 
diff --git a/t/mail/gateway.t b/t/mail/gateway.t
index 6ff1911..68f5f6a 100644
--- a/t/mail/gateway.t
+++ b/t/mail/gateway.t
@@ -57,7 +57,7 @@ use strict;
 use warnings;
 
 
-use RT::Test config => 'Set( $UnsafeEmailCommands, 1);', tests => 159;
+use RT::Test config => 'Set(UnsafeEmailCommands => 1);', tests => 159;
 my ($baseurl, $m) = RT::Test->started_ok;
 
 use RT::Tickets;

-----------------------------------------------------------------------


More information about the Rt-commit mailing list