[Bps-public-commit] Plack-Middleware-Test-StashWarnings branch, master, updated. 435d26feb25676ca2eea1316226bdcfb7548479e

Shawn Moore sartak at bestpractical.com
Wed Jun 8 16:50:35 EDT 2011


The branch, master has been updated
       via  435d26feb25676ca2eea1316226bdcfb7548479e (commit)
       via  ad18bf8da2908929ab48597c79b9fee0ebe2b39d (commit)
      from  29d9eacdb0107beeac59acca68006378c7f2510f (commit)

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

- Log -----------------------------------------------------------------
commit ad18bf8da2908929ab48597c79b9fee0ebe2b39d
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Jun 8 16:49:28 2011 -0400

    Provide a useful, complete get_warnings method

diff --git a/lib/Plack/Middleware/Test/StashWarnings.pm b/lib/Plack/Middleware/Test/StashWarnings.pm
index 2bbadb0..1004941 100644
--- a/lib/Plack/Middleware/Test/StashWarnings.pm
+++ b/lib/Plack/Middleware/Test/StashWarnings.pm
@@ -68,13 +68,22 @@ Plack::Middleware::Test::StashWarnings - Test your application's warnings
 
 =head1 SYNOPSIS
 
+  # for your PSGI application:
   enable "Test::StashWarnings";
 
 
+  # for your Test::WWW::Mechanize subclass:
   use Storable 'thaw';
-  $mech->get('/__test_warnings');
-  my @warnings = @{ thaw($mech->content) };
-  like(@warnings[0], qr/No private key/);
+  sub get_warnings {
+      local $Test::Builder::Level = $Test::Builder::Level + 1;
+      my $self = shift;
+  
+      my $clone = $self->clone;
+      return unless $clone->get_ok('/__test_warnings');
+  
+      my @warnings = @{ thaw $clone->content };
+      return @warnings;
+  }
 
 =head1 DESCRIPTION
 

commit 435d26feb25676ca2eea1316226bdcfb7548479e
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Jun 8 16:50:29 2011 -0400

    Typo fix

diff --git a/lib/Plack/Middleware/Test/StashWarnings.pm b/lib/Plack/Middleware/Test/StashWarnings.pm
index 1004941..5139504 100644
--- a/lib/Plack/Middleware/Test/StashWarnings.pm
+++ b/lib/Plack/Middleware/Test/StashWarnings.pm
@@ -101,7 +101,7 @@ content.
 Warnings are an important part of any application. Your web application should
 warn its operators when something is amiss.
 
-Almost as importantly, your web application should gracefully copes with bad
+Almost as importantly, your web application should gracefully cope with bad
 input, the back button, and all other aspects of the user experience.
 
 Unfortunately, tests seldom cover what happens when things go poorly. Are you

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



More information about the Bps-public-commit mailing list