[Bps-public-commit] r14809 - RT-Extension-CommandByEmail/t

falcone at bestpractical.com falcone at bestpractical.com
Tue Aug 5 17:42:35 EDT 2008


Author: falcone
Date: Tue Aug  5 17:42:34 2008
New Revision: 14809

Modified:
   RT-Extension-CommandByEmail/t/02.create.t
   RT-Extension-CommandByEmail/t/03.update.t
   RT-Extension-CommandByEmail/t/04.send.t

Log:
* fix tests to work with 3.8

Modified: RT-Extension-CommandByEmail/t/02.create.t
==============================================================================
--- RT-Extension-CommandByEmail/t/02.create.t	(original)
+++ RT-Extension-CommandByEmail/t/02.create.t	Tue Aug  5 17:42:34 2008
@@ -95,7 +95,7 @@
 diag("set date on create") if $ENV{'TEST_VERBOSE'};
 foreach my $field ( qw(Due Starts Started) ) {
     my $value = '2005-12-01 12:34:00';
-    my $date_obj = RT::Date->new( $RT::System );
+    my $date_obj = RT::Date->new( $RT::SystemUser );
     $date_obj->Set( Format => 'unknown', Value => $value );
 
     my $text = <<END;

Modified: RT-Extension-CommandByEmail/t/03.update.t
==============================================================================
--- RT-Extension-CommandByEmail/t/03.update.t	(original)
+++ RT-Extension-CommandByEmail/t/03.update.t	Tue Aug  5 17:42:34 2008
@@ -68,7 +68,7 @@
 diag("set date on update") if $ENV{'TEST_VERBOSE'};
 foreach my $field ( qw(Due Starts Started) ) {
     my $value = '2005-12-01 12:34:00';
-    my $date_obj = RT::Date->new( $RT::System );
+    my $date_obj = RT::Date->new( $RT::SystemUser );
     $date_obj->Set( Format => 'unknown', Value => $value );
 
     my $text = <<END;

Modified: RT-Extension-CommandByEmail/t/04.send.t
==============================================================================
--- RT-Extension-CommandByEmail/t/04.send.t	(original)
+++ RT-Extension-CommandByEmail/t/04.send.t	Tue Aug  5 17:42:34 2008
@@ -7,8 +7,7 @@
 
 use File::Temp qw/ tempfile tempdir /;
 
-use RT;
-RT::LoadConfig;
+BEGIN { require 't/utils.pl' }
 RT::Init;
 
 diag("test errors via mailgate") if $ENV{'TEST_VERBOSE'};
@@ -26,9 +25,15 @@
 
     my ($fh, $filename) = tempfile();
     diag("Tempfile: $filename");
-    $RT::SendmailPath = "cat > $filename";
-    $RT::SendmailBounceArguments = '';
-    $RT::SendmailArguments = '';
+    if (RT->can('Config') && RT->Config->can('Set')) {
+        RT->Config->Set(SendmailPath => "cat > $filename");
+        RT->Config->Set(SendmailBounceArguments => '');
+        RT->Config->Set(SendmailArguments => '');
+    } else {
+        $RT::SendmailPath = "cat > $filename";
+        $RT::SendmailBounceArguments = '';
+        $RT::SendmailArguments = '';
+    }
 
     use RT::EmailParser;
     my $parser = RT::EmailParser->new();



More information about the Bps-public-commit mailing list