unlink the DBM::Deep file at BEGIN time too to prevent failure after an interrupted run
Yuval Kogman [Wed, 16 Apr 2008 00:55:42 +0000 (00:55 +0000)]
t/200_examples/002_example_Moose_POOP.t

index f7b5f81..0298123 100644 (file)
@@ -16,6 +16,15 @@ BEGIN {
 use Test::Exception;
 
 BEGIN {
+    # in case there are leftovers
+    unlink('newswriter.db') if -e 'newswriter.db';
+}
+
+END {
+    unlink('newswriter.db') if -e 'newswriter.db';
+}
+
+BEGIN {
     use_ok('Moose');           
 }
 
@@ -429,4 +438,3 @@ Moose::POOP::Meta::Instance->_reload_db();
     
 }
 
-unlink('newswriter.db') if -e 'newswriter.db';
\ No newline at end of file