[Rt-commit] rt branch, 4.2/adjust-get-ok-test-level, created. rt-4.1.5-177-gff9d0e2
Alex Vandiver
alexmv at bestpractical.com
Fri Dec 28 19:30:50 EST 2012
The branch, 4.2/adjust-get-ok-test-level has been created
at ff9d0e2b634e3b9df291123e1a6d79010df37d2b (commit)
- Log -----------------------------------------------------------------
commit e551d98d8869841cc2ae31289ef2e40d5b3f121b
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Apr 23 08:14:23 2011 +0400
adjust Test::Builder's level
diff --git a/lib/RT/Test/Web.pm b/lib/RT/Test/Web.pm
index 831ad99..2a042ff 100644
--- a/lib/RT/Test/Web.pm
+++ b/lib/RT/Test/Web.pm
@@ -77,6 +77,8 @@ sub get_ok {
if ( $url =~ s!^/!! ) {
$url = $self->rt_base_url . $url;
}
+
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
my $rv = $self->SUPER::get_ok($url, @_);
Test::More::diag( "Couldn't get $url" ) unless $rv;
return $rv;
commit e4a76779aa87ca20efb22e3f021e169666dc0d62
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Fri Jul 20 14:15:48 2012 -0700
Always throw away warnings caused by compilation tests
e551d98 causes tests to unexpectedly pass because the get_ok inherent to
no_warnings_ok (which is additional to the check that the warnings are
empty) now counts as part of the TODO'd block.
As in this case we do not have any particular expectation that
compilation tests will ever be warnings clean, simply switch to clearing
the caught warnings.
diff --git a/t/web/compilation_errors.t b/t/web/compilation_errors.t
index 0ae6ead..399268a 100644
--- a/t/web/compilation_errors.t
+++ b/t/web/compilation_errors.t
@@ -6,7 +6,7 @@ BEGIN {
sub wanted {
-f && /\.html$/ && $_ !~ /Logout.html$/ && $File::Find::dir !~ /RichText/;
}
- my $tests = 8;
+ my $tests = 7;
find( sub { wanted() and $tests += 4 }, 'share/html/' );
plan tests => $tests + 1; # plus one for warnings check
}
@@ -39,10 +39,8 @@ $agent->content_contains('Logout', "Found a logout link");
find ( sub { wanted() and test_get($agent, $File::Find::name) } , 'share/html/');
-TODO: {
- local $TODO = "we spew *lots* of undef warnings";
- $agent->no_warnings_ok;
-};
+# We expect to spew a lot of warnings; toss them away
+$agent->get_warnings;
sub test_get {
my $agent = shift;
commit ff9d0e2b634e3b9df291123e1a6d79010df37d2b
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Fri Dec 28 19:30:00 2012 -0500
Add more Test::Builder::Level bumps where there are tests
diff --git a/lib/RT/Test.pm b/lib/RT/Test.pm
index acba2ce..6e1df81 100644
--- a/lib/RT/Test.pm
+++ b/lib/RT/Test.pm
@@ -1092,6 +1092,7 @@ sub send_via_mailgate {
sub open_mailgate_ok {
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
my $class = shift;
my $baseurl = shift;
my $queue = shift || 'general';
@@ -1102,6 +1103,7 @@ sub open_mailgate_ok {
sub close_mailgate_ok {
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
my $class = shift;
my $mail = shift;
close $mail;
@@ -1109,6 +1111,7 @@ sub close_mailgate_ok {
}
sub mailsent_ok {
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
my $class = shift;
my $expected = shift;
@@ -1514,6 +1517,7 @@ sub test_app {
}
sub start_plack_server {
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
my $self = shift;
require Plack::Loader;
@@ -1564,6 +1568,7 @@ sub start_plack_server {
our $TEST_APP;
sub start_inline_server {
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
my $self = shift;
require Test::WWW::Mechanize::PSGI;
@@ -1581,6 +1586,7 @@ sub start_inline_server {
}
sub start_apache_server {
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
my $self = shift;
my %server_opt = @_;
$server_opt{variant} ||= 'mod_perl';
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list