r13925@rob-kinyons-powerbook58: rob | 2006-06-02 14:29:05 -0400
[p5sagit/Excel-Template.git] / t / 024_image.t
CommitLineData
d3018037 1BEGIN{ $^W = 0 }
2use strict;
3
4use Test::More tests => 4;
5
6use lib 't';
7use mock;
8mock::reset;
9
10my $CLASS = 'Excel::Template';
11use_ok( $CLASS );
12
13my $object = $CLASS->new(
14 file => \*DATA,
15);
16isa_ok( $object, $CLASS );
17
18ok( $object->write_file( 'filename' ), 'Successfuly wrote file' );
19
20my @calls = mock::get_calls;
21is( join( $/, @calls, '' ), <<__END_EXPECTED__, 'Calls match up' );
22Spreadsheet::WriteExcel::new( 'filename' )
23Spreadsheet::WriteExcel::add_format( '' )
24Spreadsheet::WriteExcel::add_worksheet( '' )
25Spreadsheet::WriteExcel::Worksheet::new( '' )
26Spreadsheet::WriteExcel::Worksheet::write( '0', '0', 'before', '1' )
cf663350 27Spreadsheet::WriteExcel::Worksheet::insert_bitmap( '0', '1', '/full/path', '0', '0', '0', '0' )
d3018037 28Spreadsheet::WriteExcel::Worksheet::write( '0', '2', 'after', '1' )
cf663350 29Spreadsheet::WriteExcel::Worksheet::insert_bitmap( '0', '3', '/full/path', '2', '2', '0', '0' )
30Spreadsheet::WriteExcel::Worksheet::insert_bitmap( '0', '4', '/full/path', '0', '0', '2', '2' )
31Spreadsheet::WriteExcel::Worksheet::insert_bitmap( '0', '5', '/full/path', '0', '1', '1.1', '0' )
d3018037 32Spreadsheet::WriteExcel::close( '' )
33__END_EXPECTED__
34
35__DATA__
36<workbook>
37 <worksheet>
38 <cell text="before" />
39 <image path="/full/path" />
40 <cell text="after" />
41 <image path="/full/path" offset="2,2"/>
42 <image path="/full/path" scale="2,2"/>
43 <image path="/full/path" scale="1.1,0" offset="0,1"/>
44 </worksheet>
45</workbook>