Commit | Line | Data |
ddb9abcf |
1 | BEGIN{ $^W = 0 } |
2 | use strict; |
3 | |
4 | use Test::More tests => 4; |
5 | |
6 | use lib 't'; |
7 | use mock; |
8 | mock::reset; |
9 | |
10 | my $CLASS = 'Excel::Template'; |
11 | use_ok( $CLASS ); |
12 | |
13 | my $object = $CLASS->new( |
14 | file => \*DATA, |
15 | ); |
16 | isa_ok( $object, $CLASS ); |
17 | |
18 | ok( $object->write_file( 'filename' ), 'Successfuly wrote file' ); |
19 | |
20 | my @calls = mock::get_calls; |
21 | is( join( $/, @calls, '' ), <<__END_EXPECTED__, 'Calls match up' ); |
22 | Spreadsheet::WriteExcel::new( 'filename' ) |
23 | Spreadsheet::WriteExcel::add_format( '' ) |
24 | Spreadsheet::WriteExcel::add_worksheet( '' ) |
25 | Spreadsheet::WriteExcel::Worksheet::new( '' ) |
26 | Spreadsheet::WriteExcel::Worksheet::write( '0', '0', '', '1' ) |
27 | Spreadsheet::WriteExcel::Worksheet::write( '0', '1', '', '1' ) |
28 | Spreadsheet::WriteExcel::add_format( '' ) |
29 | Spreadsheet::WriteExcel::Worksheet::merge_range( 'A1:B1', 'This is the Foo Range', '2' ) |
30 | Spreadsheet::WriteExcel::close( '' ) |
31 | __END_EXPECTED__ |
32 | |
33 | __DATA__ |
34 | <workbook> |
35 | <worksheet> |
36 | <cell ref="foo" /> |
37 | <cell ref="foo" /> |
38 | <format is_merged="1"> |
39 | <merge_range ref="foo" text="This is the Foo Range" /> |
40 | </format> |
41 | </worksheet> |
42 | </workbook> |