Commit | Line | Data |
dba6a68e |
1 | use strict; |
dba6a68e |
2 | |
3 | use Test::More tests => 5; |
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 => 't/011.xml', |
14 | ); |
15 | isa_ok( $object, $CLASS ); |
16 | |
17 | ok( |
18 | $object->param( |
19 | loopy => [ |
20 | { int => 0, char => 'n' }, |
21 | { int => 0, char => 'y' }, |
22 | { int => 1, char => 'n' }, |
23 | { int => 1, char => 'y' }, |
24 | ], |
25 | ), |
26 | 'Parameters set', |
27 | ); |
28 | |
29 | ok( $object->write_file( 'filename' ), 'Something returned' ); |
30 | |
31 | my @calls = mock->get_calls; |
32 | is( join( $/, @calls, '' ), <<__END_EXPECTED__, 'Calls match up' ); |
33 | Spreadsheet::WriteExcel::new( 'filename' ) |
34 | Spreadsheet::WriteExcel::add_format( '' ) |
35 | Spreadsheet::WriteExcel::add_worksheet( 'conditional' ) |
36 | Spreadsheet::WriteExcel::Worksheet::new( '' ) |
37 | Spreadsheet::WriteExcel::Worksheet::write( '0', '0', 'not bool', '1' ) |
38 | Spreadsheet::WriteExcel::Worksheet::write( '0', '1', 'int', '1' ) |
39 | Spreadsheet::WriteExcel::Worksheet::write( '1', '0', 'not bool', '1' ) |
40 | Spreadsheet::WriteExcel::Worksheet::write( '1', '1', 'int', '1' ) |
41 | Spreadsheet::WriteExcel::Worksheet::write( '1', '2', 'char', '1' ) |
42 | Spreadsheet::WriteExcel::Worksheet::write( '2', '0', 'bool', '1' ) |
43 | Spreadsheet::WriteExcel::Worksheet::write( '3', '0', 'bool', '1' ) |
44 | Spreadsheet::WriteExcel::Worksheet::write( '3', '1', 'char', '1' ) |
45 | Spreadsheet::WriteExcel::close( '' ) |
46 | __END_EXPECTED__ |