Skip to content

Commit

Permalink
Merge branch '4.0/web-installer-warnings' into 4.0-trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
jibsheet committed Apr 25, 2012
2 parents 20c87c6 + 0b5adf4 commit f4475ca
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
11 changes: 10 additions & 1 deletion lib/RT/Test.pm
Expand Up @@ -1313,6 +1313,10 @@ sub test_app {

my $app;

my $warnings = "";
open( my $warn_fh, ">", \$warnings );
local *STDERR = $warn_fh;

if ($server_opt{variant} and $server_opt{variant} eq 'rt-server') {
$app = do {
my $file = "$RT::SbinPath/rt-server";
Expand All @@ -1330,7 +1334,8 @@ sub test_app {
}

require Plack::Middleware::Test::StashWarnings;
$app = Plack::Middleware::Test::StashWarnings->wrap($app);
my $stashwarnings = Plack::Middleware::Test::StashWarnings->new;
$app = $stashwarnings->wrap($app);

if ($server_opt{basic_auth}) {
require Plack::Middleware::Auth::Basic;
Expand All @@ -1342,6 +1347,10 @@ sub test_app {
}
);
}

close $warn_fh;
$stashwarnings->add_warning( $warnings ) if $warnings;

return $app;
}

Expand Down
2 changes: 1 addition & 1 deletion sbin/rt-test-dependencies.in
Expand Up @@ -288,7 +288,7 @@ Test::Builder 0.90 # needed for is_passing
Test::MockTime
Log::Dispatch::Perl
Test::WWW::Mechanize::PSGI
Plack::Middleware::Test::StashWarnings
Plack::Middleware::Test::StashWarnings 0.06
Test::LongString
.

Expand Down
3 changes: 3 additions & 0 deletions t/web/installer.t
Expand Up @@ -10,6 +10,9 @@ use RT::Test

my ($base, $m) = RT::Test->started_ok;

$m->warning_like(qr/If this is a new installation of RT/,
"Got startup warning");

$m->get_ok($base);
like $m->uri, qr/Install/, 'at installer';

Expand Down

0 comments on commit f4475ca

Please sign in to comment.