Commit | Line | Data |
d01e4722 |
1 | use strict; |
2 | |
3 | use Test::More tests => 4; |
4 | |
5 | use lib 't'; |
6 | use mock; |
7 | mock::reset; |
8 | |
9 | my $CLASS = 'Excel::Template'; |
10 | use_ok( $CLASS ); |
11 | |
12 | my $object = $CLASS->new( |
13 | filename => \*DATA, |
14 | ); |
15 | isa_ok( $object, $CLASS ); |
16 | |
17 | ok( $object->write_file( 'filename' ), 'Something returned' ); |
18 | |
19 | my @calls = mock::get_calls; |
20 | is( join( $/, @calls, '' ), <<__END_EXPECTED__, 'Calls match up' ); |
21 | Spreadsheet::WriteExcel::new( 'filename' ) |
22 | Spreadsheet::WriteExcel::add_format( '' ) |
23 | Spreadsheet::WriteExcel::add_worksheet( 'worksheet attributes' ) |
24 | Spreadsheet::WriteExcel::Worksheet::new( '' ) |
25 | Spreadsheet::WriteExcel::Worksheet::keep_leading_zeros( '1' ) |
26 | Spreadsheet::WriteExcel::Worksheet::write( '0', '0', '03', '1' ) |
27 | Spreadsheet::WriteExcel::close( '' ) |
28 | __END_EXPECTED__ |
29 | |
30 | __DATA__ |
31 | <workbook> |
32 | <worksheet name="worksheet attributes" keep_leading_zeros="1"> |
33 | <cell text="03" /> |
34 | </worksheet> |
35 | </workbook> |