31d84484993e808228c18d31aa51a89f278ce5d4
[p5sagit/Excel-Template.git] / t / Spreadsheet / WriteExcel.pm
1 package Spreadsheet::WriteExcel;
2
3 use strict;
4
5 use mock;
6 use Spreadsheet::WriteExcel::Worksheet;
7
8 sub new {
9     my $self = bless {
10     }, shift;
11
12     {
13         local $" = "', '";
14         push @mock::calls, ref($self) . "::new( '@_' )";
15     }
16
17     return $self;
18 }
19
20 sub close {
21     my $self = shift;
22     {
23         local $" = "', '";
24         push @mock::calls, ref($self) . "::close( '@_' )";
25     }
26 }
27
28 sub add_worksheet {
29     my $self = shift;
30     {
31         local $" = "', '";
32         push @mock::calls, ref($self) . "::add_worksheet( '@_' )";
33     }
34     return Spreadsheet::WriteExcel::Worksheet->new;
35 }
36
37 my $format_num = 1;
38 sub add_format {
39     my $self = shift;
40     my %x = @_;
41     my @x = map { $_ => $x{$_} } sort keys %x;
42     {
43         local $" = "', '";
44         push @mock::calls, ref($self) . "::add_format( '@x' )";
45     }
46     return $format_num++;
47 }
48
49 1;
50 __END__