[Rt-commit] rt branch, 4.2/smime-v2, updated. rt-4.0.4-369-g82b7145
Ruslan Zakirov
ruz at bestpractical.com
Thu Jan 12 16:58:27 EST 2012
The branch, 4.2/smime-v2 has been updated
via 82b7145dc78416f83ec254f315dd079af999e905 (commit)
via f08bfdb8ad9b5573f88d8070bb47198cbca5ce63 (commit)
from 02219dc77a36c2b852ad3527ca0fc9a132cf7253 (commit)
Summary of changes:
lib/RT/Test/Web.pm | 14 ++++++++++++--
t/mail/smime/realmail.t | 2 +-
2 files changed, 13 insertions(+), 3 deletions(-)
- Log -----------------------------------------------------------------
commit f08bfdb8ad9b5573f88d8070bb47198cbca5ce63
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Fri Jan 13 00:54:24 2012 +0400
call ::Test::Web->no_warnings_ok before GD
Most instances of RT::Test::Web class are destroyed
during global destruction. We call ->no_warnings_ok
in DESTROY and It's just luck we don't hit problems.
Use END block instead.
diff --git a/lib/RT/Test/Web.pm b/lib/RT/Test/Web.pm
index cc12026..1e49707 100644
--- a/lib/RT/Test/Web.pm
+++ b/lib/RT/Test/Web.pm
@@ -52,15 +52,19 @@ use strict;
use warnings;
use base qw(Test::WWW::Mechanize);
+use Scalar::Util qw(weaken);
-require RT::Test;
+BEGIN { require RT::Test; }
require Test::More;
+my $instance;
+
sub new {
my ($class, @args) = @_;
push @args, app => $RT::Test::TEST_APP if $RT::Test::TEST_APP;
- my $self = $class->SUPER::new(@args);
+ my $self = $instance = $class->SUPER::new(@args);
+ weaken $instance;
$self->cookie_jar(HTTP::Cookies->new);
return $self;
@@ -346,4 +350,10 @@ sub DESTROY {
}
}
+END {
+ return unless $instance;
+ return if RT::Test->builder->{Original_Pid} != $$;
+ $instance->no_warnings_ok if !$RT::Test::Web::DESTROY++;
+}
+
1;
commit 82b7145dc78416f83ec254f315dd079af999e905
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Fri Jan 13 01:58:03 2012 +0400
adjust number of tests
diff --git a/t/mail/smime/realmail.t b/t/mail/smime/realmail.t
index dc9722d..f84f475 100644
--- a/t/mail/smime/realmail.t
+++ b/t/mail/smime/realmail.t
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use RT::Test::SMIME tests => 93;
+use RT::Test::SMIME tests => 92;
use Digest::MD5 qw(md5_hex);
my $test = 'RT::Test::SMIME';
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list