Improved tests and documentation. Fixed a few bugs in register()
[p5sagit/Excel-Template.git] / t / Spreadsheet / WriteExcel.pm
index 31d8448..cab958d 100644 (file)
@@ -14,6 +14,8 @@ sub new {
         push @mock::calls, ref($self) . "::new( '@_' )";
     }
 
+    $self->{file} = shift;
+
     return $self;
 }
 
@@ -23,6 +25,11 @@ sub close {
         local $" = "', '";
         push @mock::calls, ref($self) . "::close( '@_' )";
     }
+
+    if ( ref $self->{file} ) {
+        my $fh = $self->{file};
+        print $fh join "\n", @mock::calls, ''; 
+    }
 }
 
 sub add_worksheet {