Commit | Line | Data |
b6bc5a5d |
1 | use strict; |
b6bc5a5d |
2 | |
3 | use Test::More tests => 5; |
4 | |
5 | use lib 't'; |
6 | use mock; |
c11fa570 |
7 | mock::reset; |
b6bc5a5d |
8 | |
9 | my $CLASS = 'Excel::Template'; |
10 | use_ok( $CLASS ); |
11 | |
12 | my $object = $CLASS->new( |
13 | filename => 't/006.xml', |
14 | ); |
15 | isa_ok( $object, $CLASS ); |
16 | |
17 | ok( |
18 | $object->param( |
19 | test1 => 'test1', |
20 | test2 => 'test2', |
21 | ), |
22 | 'Parameters set', |
23 | ); |
24 | |
25 | ok( $object->write_file( 'filename' ), 'Something returned' ); |
26 | |
c11fa570 |
27 | my @calls = mock::get_calls; |
b6bc5a5d |
28 | is( join( $/, @calls, '' ), <<__END_EXPECTED__, 'Calls match up' ); |
29 | Spreadsheet::WriteExcel::new( 'filename' ) |
30 | Spreadsheet::WriteExcel::add_format( '' ) |
31 | Spreadsheet::WriteExcel::add_worksheet( 'cell' ) |
32 | Spreadsheet::WriteExcel::Worksheet::new( '' ) |
33 | Spreadsheet::WriteExcel::Worksheet::write( '0', '0', 'test1', '1' ) |
34 | Spreadsheet::WriteExcel::Worksheet::write( '0', '1', 'test2', '1' ) |
35 | Spreadsheet::WriteExcel::Worksheet::write( '0', '2', 'PRE test1 POST', '1' ) |
36 | Spreadsheet::WriteExcel::close( '' ) |
37 | __END_EXPECTED__ |