[Jifty-commit] r1881 -

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Wed Aug 30 17:42:43 EDT 2006


Author: schwern
Date: Wed Aug 30 17:42:43 2006
New Revision: 1881

Modified:
   /   (props changed)
   jifty/trunk/lib/Jifty/Test.pm

Log:
 r17561 at windhund:  schwern | 2006-08-30 15:34:08 -0400
 Add Jifty::Test->teardown_mailbox to mirror setup_mailbox


Modified: jifty/trunk/lib/Jifty/Test.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Test.pm	(original)
+++ jifty/trunk/lib/Jifty/Test.pm	Wed Aug 30 17:42:43 2006
@@ -171,9 +171,21 @@
 =cut
 
 sub setup_mailbox {
-    open my $f, ">:encoding(UTF-8)", mailbox();
+    my $class = shift;
+
+    open my $f, ">:encoding(UTF-8)", $class->mailbox;
     close $f;
-} 
+}
+
+=head2 teardown_mailbox
+
+Deletes the mailbox.
+
+=cut
+
+sub teardown_mailbox {
+    unlink mailbox();
+}
 
 =head2 is_available
 
@@ -220,7 +232,7 @@
     # If all tests passed..
     unless ($Test->expected_tests != $Test->current_test or grep {not $_} $Test->summary) {
         # Clean up mailbox
-        unlink mailbox();
+        Jifty::Test->teardown_mailbox;
 
         # Remove testing db
         if (Jifty->handle) {


More information about the Jifty-commit mailing list