cpan/ExtUtils-ParseXS/t/XSUsage.xs ExtUtils::ParseXS tests
cpan/File-Fetch/lib/File/Fetch.pm File::Fetch
cpan/File-Fetch/t/01_File-Fetch.t File::Fetch tests
+cpan/File-Fetch/t/null_subclass.t
cpan/File-Path/lib/File/Path.pm Do things like 'mkdir -p' and 'rm -r'
cpan/File-Path/t/Path.t See if File::Path works
cpan/File-Path/t/taint.t See if File::Path works with -T
'File::Fetch' =>
{
'MAINTAINER' => 'kane',
- 'DISTRIBUTION' => 'BINGOS/File-Fetch-0.22.tar.gz',
+ 'DISTRIBUTION' => 'BINGOS/File-Fetch-0.24.tar.gz',
'FILES' => q[cpan/File-Fetch],
'CPAN' => 1,
'UPSTREAM' => 'cpan',
$FTP_PASSIVE $TIMEOUT $DEBUG $WARN
];
-$VERSION = '0.22';
+$VERSION = '0.24';
$VERSION = eval $VERSION; # avoid warnings with development releases
$PREFER_BIN = 0; # XXX TODO implement
$FROM_EMAIL = 'File-Fetch@example.com';
bless $args, $class;
if( lc($args->scheme) ne 'file' and not $args->host ) {
- return File::Fetch->_error(loc(
+ return $class->_error(loc(
"Hostname required when fetching from '%1'",$args->scheme));
}
for (qw[path file]) {
unless( $args->$_() ) { # 5.5.x needs the ()
- return File::Fetch->_error(loc("No '%1' specified",$_));
+ return $class->_error(loc("No '%1' specified",$_));
}
}
check( $tmpl, \%hash ) or return;
### parse the uri to usable parts ###
- my $href = __PACKAGE__->_parse_uri( $uri ) or return;
+ my $href = $class->_parse_uri( $uri ) or return;
### make it into a FFI object ###
- my $ff = File::Fetch->_create( %$href ) or return;
+ my $ff = $class->_create( %$href ) or return;
### return the object ###
--- /dev/null
+use strict;
+use warnings;
+
+use Test::More tests => 5;
+
+my $parent_class = 'File::Fetch';
+my $child_class = 'File::Fetch::Subclass';
+
+use_ok( $parent_class );
+
+my $ff_parent = $parent_class->new( uri => 'http://example.com/index.html' );
+isa_ok( $ff_parent, $parent_class );
+
+can_ok( $child_class, qw( new fetch ) );
+my $ff_child = $child_class->new( uri => 'http://example.com/index.html' );
+isa_ok( $ff_child, $child_class );
+isa_ok( $ff_child, $parent_class );
+
+BEGIN {
+ package File::Fetch::Subclass;
+ use vars qw(@ISA);
+ unshift @ISA, qw(File::Fetch);
+ }