X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F10excel.t;h=207479270815a346cc457561d40a8b1dcd4bf056;hb=f59b2c0e0d3cad2e98ed0eb440720f85a8f33a6f;hp=7bee0de1b0023fde99ea85a3156dcd2274ec0b68;hpb=fbc0552f2fa97295f7ffd616b7ed8af30e8e025e;p=dbsrgits%2FSQL-Translator.git diff --git a/t/10excel.t b/t/10excel.t index 7bee0de..2074792 100644 --- a/t/10excel.t +++ b/t/10excel.t @@ -4,18 +4,13 @@ use Test::More; use SQL::Translator; use SQL::Translator::Schema::Constants; +use Test::SQL::Translator qw(maybe_plan); -eval { - require SQL::Translator::Parser::Excel; +BEGIN { + maybe_plan(31, 'SQL::Translator::Parser::Excel'); SQL::Translator::Parser::Excel->import('parse'); -}; -if ($@) { - plan skip_all => "$@"; } -else { - plan tests => 31; -} - + my $tr = SQL::Translator->new(parser => "Excel"); my $t = $tr->translate(filename => "t/data/Excel/t.xls"); my $schema = $tr->schema; @@ -48,10 +43,16 @@ is( $f3->size, 1, 'Size is "1"' ); is( $f3->is_primary_key, 0, 'Field is not PK' ); my $f4 = shift @fields; -is( $f4->name, 'math', 'Fourth field name is "math"' ); -is( lc $f4->data_type, 'float', 'Data type is "float"' ); -is( $f4->size, '3,1', 'Size is "3,1"' ); -is( $f4->is_primary_key, 0, 'Field is not PK' ); +TODO: { + eval { require Spreadsheet::ParseExcel }; + todo_skip "Bug in Spreadsheet::ParseExcel, http://rt.cpan.org/Public/Bug/Display.html?id=39892", 4 + if ( $Spreadsheet::ParseExcel::VERSION > 0.32 and $Spreadsheet::ParseExcel::VERSION < 0.41 ); + + is( $f4->name, 'math', 'Fourth field name is "math"' ); + is( lc $f4->data_type, 'float', 'Data type is "float"' ); + is( $f4->size, '3,1', 'Size is "3,1"' ); + is( $f4->is_primary_key, 0, 'Field is not PK' ); +} my $f5 = shift @fields; is( $f5->name, 'bitmap', 'Fifth field name is "bitmap"' );