Release history for Module-Metadata
+ - Fix reliance on recent Test::Builder
+ - Make tests perl 5.6 compatible
+
1.000012 - 2013-05-04
- improved package detection heuristics (thanks, Edward Zborowski!)
- fix ->contains_pod (RT#84932, Tokuhiro Matsuno)
use Test::More tests => 3;
use Module::Metadata;
+*fh_from_string = $] < 5.008
+ ? require IO::Scalar && sub ($) {
+ IO::Scalar->new(\$_[0]);
+ }
+ : sub ($) {
+ open my $fh, '<', \$_[0];
+ $fh
+ }
+;
+
{
my $src = <<'...';
package Foo;
1;
...
- open my $fh, '<', \$src;
+ my $fh = fh_from_string($src);
my $module = Module::Metadata->new_from_handle($fh, 'Foo.pm');
ok(!$module->contains_pod(), 'This module does not contains POD');
}
Foo - bar
...
- open my $fh, '<', \$src;
+ my $fh = fh_from_string($src);
my $module = Module::Metadata->new_from_handle($fh, 'Foo.pm');
ok($module->contains_pod(), 'This module contains POD');
}
Tokuhiro Matsuno
...
- open my $fh, '<', \$src;
+ my $fh = fh_from_string($src);
my $module = Module::Metadata->new_from_handle($fh, 'Foo.pm');
ok($module->contains_pod(), 'This module contains POD');
}
use strict;
use warnings;
use utf8;
-use Test::More;
+use Test::More tests => 2;
use Module::Metadata;
# This test case tests about parsing pod after `__END__` token.
my $pm_info = Module::Metadata->new_from_file('t/lib/ENDPOD.pm', collect_pod => 1,);
is( $pm_info->name, 'ENDPOD', 'found default package' );
is(join(',', $pm_info->pod_inside), 'NAME');
-
-done_testing;
-