Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > f7b7788e4a5e36f311bc5e029e616f0f > files > 17

perl-Archive-Any-0.0932-7.fc16.noarch.rpm

#!/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";