[Rt-commit] rt branch, 4.0/set-mime-encoding-fallback, updated. rt-4.0.1rc1-22-g0dcc9e1

? sunnavy sunnavy at bestpractical.com
Thu Aug 4 02:41:50 EDT 2011


The branch, 4.0/set-mime-encoding-fallback has been updated
       via  0dcc9e1c2cdaa2b0d5330e18d84b9da73e522608 (commit)
      from  4a4c702afa3f0b4951381e0fefec7e140cf38ba2 (commit)

Summary of changes:
 t/mail/sendmail.t |   28 +++++++++++++++++++---------
 1 files changed, 19 insertions(+), 9 deletions(-)

- Log -----------------------------------------------------------------
commit 0dcc9e1c2cdaa2b0d5330e18d84b9da73e522608
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu Aug 4 14:32:37 2011 +0800

    rewrite tests to avoid todo tests unexpectedly passing

diff --git a/t/mail/sendmail.t b/t/mail/sendmail.t
index 2883141..d0529ba 100644
--- a/t/mail/sendmail.t
+++ b/t/mail/sendmail.t
@@ -3,7 +3,7 @@
 use strict;
 use File::Spec ();
 
-use RT::Test tests => 139;
+use RT::Test tests => 141;
 use Test::Warn;
 
 use RT::EmailParser;
@@ -316,20 +316,30 @@ $parser->ParseMIMEEntityFromScalar($content);
 
  %args =        (message => $content, queue => 1, action => 'correspond');
 
+{
+
+my @warnings;
+local $SIG{__WARN__} = sub {
+    push @warnings, "@_";
+};
+
+RT::Interface::Email::Gateway(\%args);
+
 TODO: {
         local $TODO =
 'need a better approach of encoding converter, should be fixed in 4.2';
+ok( @warnings == 1 || @warnings == 2, "1 or 2 warnings are ok" );
+ok( @warnings == 1 || ( @warnings == 2 && $warnings[1] eq $warnings[0] ),
+    'if there are 2 warnings, they should be same' );
 
-warnings_like {
- RT::Interface::Email::Gateway(\%args);
-}
-[
-    qr/Encoding error: "\\x\{041f\}" does not map to iso-8859-1 .*/,
-    qr/Encoding error: "\\x\{041f\}" does not map to iso-8859-1 .*/
-    ],
-"The badly formed Russian spam we have isn't actually well-formed UTF8, which makes Encode (correctly) warn";
+like(
+    $warnings[0],
+    qr/\QEncoding error: "\x{041f}" does not map to iso-8859-1/,
+"The badly formed Russian spam we have isn't actually well-formed UTF8, which makes Encode (correctly) warn",
+);
 
 }
+}
 
  $tickets = RT::Tickets->new(RT->SystemUser);
 $tickets->OrderBy(FIELD => 'id', ORDER => 'DESC');

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


More information about the Rt-commit mailing list