[Bps-public-commit] Plack-Middleware-Test-StashWarnings branch, master, updated. 98f14e6d8612927a5b519ff1020b998ffe69d4bd

Shawn Moore sartak at bestpractical.com
Wed Nov 17 13:59:12 EST 2010


The branch, master has been updated
       via  98f14e6d8612927a5b519ff1020b998ffe69d4bd (commit)
       via  e84d6ce6454101fd1f262ba1faf5c240ccf06e60 (commit)
       via  c73b9ae0c490a1e32a691a70bdc4a66a53ecc13f (commit)
      from  48749301cf8efa36e94bb7d828802fbb7c31dcf7 (commit)

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

- Log -----------------------------------------------------------------
commit c73b9ae0c490a1e32a691a70bdc4a66a53ecc13f
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Nov 17 13:56:41 2010 -0500

    Copy the doc from the original StashWarnings

diff --git a/lib/Plack/Middleware/Test/StashWarnings.pm b/lib/Plack/Middleware/Test/StashWarnings.pm
index 914910d..1a69ee4 100644
--- a/lib/Plack/Middleware/Test/StashWarnings.pm
+++ b/lib/Plack/Middleware/Test/StashWarnings.pm
@@ -81,6 +81,24 @@ Plack::Middleware::Test::StashWarnings is a Plack middleware component to
 record warnings generated by your application so that you can test them to make
 sure your application complains about the right things.
 
+=head1 RATIONALE
+
+Warnings are an important part of any application. Your web application should
+warn the user when something is amiss.
+
+Almost as importantly, we want to be able to test that the web application
+gracefully copes 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
+C<sure> that your application checks authorization for that action? Are you
+C<sure> it will tomorrow?
+
+This module lets you retrieve the warnings that your forked server throws. That
+way you can test that your application continues to throw warnings when it
+makes sense. Catching the warnings also keeps your test output tidy. Finally,
+you'll be able to see when your application throws new, unexpected warnings.
+
 =head1 AUTHOR
 
 Shawn M Moore C<sartak at bestpractical.com>

commit e84d6ce6454101fd1f262ba1faf5c240ccf06e60
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Nov 17 13:58:49 2010 -0500

    Prose fixes

diff --git a/lib/Plack/Middleware/Test/StashWarnings.pm b/lib/Plack/Middleware/Test/StashWarnings.pm
index 1a69ee4..05f2c7a 100644
--- a/lib/Plack/Middleware/Test/StashWarnings.pm
+++ b/lib/Plack/Middleware/Test/StashWarnings.pm
@@ -84,20 +84,20 @@ sure your application complains about the right things.
 =head1 RATIONALE
 
 Warnings are an important part of any application. Your web application should
-warn the user when something is amiss.
+warn its operators when something is amiss.
 
-Almost as importantly, we want to be able to test that the web application
-gracefully copes with bad input, the back button, and all other aspects of the
-user experience.
+Almost as importantly, your web application should gracefully copes 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
-C<sure> that your application checks authorization for that action? Are you
-C<sure> it will tomorrow?
+I<sure> that your application correctly denies that action and logs the
+failure? Are you I<sure> it will tomorrow?
 
-This module lets you retrieve the warnings that your forked server throws. That
-way you can test that your application continues to throw warnings when it
+This module lets you retrieve the warnings that your forked server issues. That
+way you can test that your application continues to issue warnings when it
 makes sense. Catching the warnings also keeps your test output tidy. Finally,
-you'll be able to see when your application throws new, unexpected warnings.
+you'll be able to see (and be notified via failing tests) when your
+application issues new, unexpected warnings so you can fix them immediately.
 
 =head1 AUTHOR
 

commit 98f14e6d8612927a5b519ff1020b998ffe69d4bd
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Nov 17 13:58:54 2010 -0500

    Explicitly document how to get the warnings

diff --git a/lib/Plack/Middleware/Test/StashWarnings.pm b/lib/Plack/Middleware/Test/StashWarnings.pm
index 05f2c7a..2f021e4 100644
--- a/lib/Plack/Middleware/Test/StashWarnings.pm
+++ b/lib/Plack/Middleware/Test/StashWarnings.pm
@@ -81,6 +81,11 @@ Plack::Middleware::Test::StashWarnings is a Plack middleware component to
 record warnings generated by your application so that you can test them to make
 sure your application complains about the right things.
 
+The warnings generated by your application are available at a special URL
+(C</__test_warnings>), encoded with L<Storable/nfreeze>. So using
+L<Test::WWW::Mechanize> you can just C<get> that URL and L<Storable/thaw> its
+content.
+
 =head1 RATIONALE
 
 Warnings are an important part of any application. Your web application should

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



More information about the Bps-public-commit mailing list