Added more tests for conditionals. Need to fix linking in POD. - Intermediate commit!
[p5sagit/Excel-Template.git] / t / 020_worksheet_attributes.t
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::write( '0', '0', '03', '1' )
26 Spreadsheet::WriteExcel::close( '' )
27 __END_EXPECTED__
28
29 __DATA__
30 <workbook>
31   <worksheet name="worksheet attributes">
32     <cell text="03" />
33   </worksheet>
34 </workbook>