1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
#!/usr/bin/perl -w
use Test::More tests => 7;
use Test::Warn;
use_ok 'Archive::Any';
isa_ok( Archive::Any->new( 't/naughty.tar', 'tar' ), 'Archive::Any' );
# Recognizes tar files with weird extensions
isa_ok( Archive::Any->new('t/naughty.hominawoof'), 'Archive::Any' );
warning_like {
ok( !Archive::Any->new( 't/naughty.tar', 'hominawoof' ) );
}
qr{No mime type found for type 'hominawoof'}, "right warning, unknown type";
warning_like {
ok( !Archive::Any->new('t/garbage.foo') );
}
qr{No handler available for type 'text/plain'}, "right warning, no type";
|