[Bps-public-commit] Plack-Middleware-Test-StashWarnings branch, master, updated. 29d9eacdb0107beeac59acca68006378c7f2510f

Shawn Moore sartak at bestpractical.com
Wed Dec 29 20:22:14 EST 2010


The branch, master has been updated
       via  29d9eacdb0107beeac59acca68006378c7f2510f (commit)
      from  98f14e6d8612927a5b519ff1020b998ffe69d4bd (commit)

Summary of changes:
 lib/Plack/Middleware/Test/StashWarnings.pm |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit 29d9eacdb0107beeac59acca68006378c7f2510f
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Dec 29 20:22:01 2010 -0500

    Use the old SIG{__WARN__} instead of going to warn under prove -v

diff --git a/lib/Plack/Middleware/Test/StashWarnings.pm b/lib/Plack/Middleware/Test/StashWarnings.pm
index 2f021e4..2bbadb0 100644
--- a/lib/Plack/Middleware/Test/StashWarnings.pm
+++ b/lib/Plack/Middleware/Test/StashWarnings.pm
@@ -33,9 +33,10 @@ sub _stash_warnings_for {
     my $self = shift;
     my $code = shift;
 
+    my $old_warn = $SIG{__WARN__} || sub { warn @_ };
     local $SIG{__WARN__} = sub {
         push @{ $self->{stashed_warnings} }, @_;
-        warn @_ if $ENV{TEST_VERBOSE};
+        $old_warn->(@_) if $ENV{TEST_VERBOSE};
     };
 
     return $code->(@_);

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



More information about the Bps-public-commit mailing list