[Rt-commit] r14230 - in rt/branches/3.999-DANGEROUS: t/mail

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Jul 17 15:18:37 EDT 2008


Author: sunnavy
Date: Thu Jul 17 15:18:33 2008
New Revision: 14230

Modified:
   rt/branches/3.999-DANGEROUS/   (props changed)
   rt/branches/3.999-DANGEROUS/t/mail/gnupg-realmail.t

Log:
 r14644 at sunnavys-mb:  sunnavy | 2008-07-18 03:05:10 +0800
 let it be the similar as in 3.8


Modified: rt/branches/3.999-DANGEROUS/t/mail/gnupg-realmail.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/mail/gnupg-realmail.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/mail/gnupg-realmail.t	Thu Jul 17 15:18:33 2008
@@ -66,31 +66,15 @@
     }
 }
 
-sub get_contents {
-    my $eid = shift;
-
-    my $emaildatadir = RT::Test::get_relocatable_dir(File::Spec->updir(),
-        qw(data gnupg emails));
-    my ($file) = glob("$emaildatadir/$eid-*");
-    defined $file
-        or do { diag "Unable to find t/data/mails/gnupg-basic-set/$eid-*"; return };
-
-    open my $mailhandle, '<', $file
-        or do { diag "Unable to read $file: $!"; return };
-
-    my $mail = do { local $/; <$mailhandle> };
-    close $mailhandle;
-
-    return $mail;
-}
-
 sub email_ok {
     my ($eid, $usage, $format, $attachment) = @_;
     diag "email_ok $eid: $usage, $format, $attachment" if $ENV{'TEST_VERBOSE'};
 
-    my $mail = get_contents($eid)
-        or return 0;
-
+    my $emaildatadir = RT::Test::get_relocatable_dir(File::Spec->updir(),
+        qw(data gnupg emails));
+    my ($file) = glob("$emaildatadir/$eid-*");
+    my $mail = RT::Test->file_content($file);
+    
     my ($status, $id) = RT::Test->send_via_mailgate($mail);
     is ($status >> 8, 0, "$eid: The mail gateway exited normally");
     ok ($id, "$eid: got id of a newly created ticket - $id");


More information about the Rt-commit mailing list