4 use lib $ENV{PERL_CORE} ? '../lib/Module/Build/t/lib' : 't/lib';
7 use_ok 'Module::Build::PodParser';
8 ensure_blib('Module::Build::PodParser');
10 #########################
13 package IO::StringBased;
16 my ($class, $string) = @_;
18 data => [ map "$_\n", split /\n/, $string],
23 shift @{ shift()->{data} };
28 tie *FH, 'IO::StringBased', <<'EOF';
31 Foo::Bar - Perl extension for blah blah blah
35 C<Foo::Bar> was written by Engelbert Humperdinck I<E<lt>eh@example.comE<gt>> in 2004.
37 Home page: http://example.com/~eh/
43 my $pp = Module::Build::PodParser->new(fh => \*FH);
44 ok $pp, 'object created';
46 is $pp->get_author->[0], 'C<Foo::Bar> was written by Engelbert Humperdinck I<E<lt>eh@example.comE<gt>> in 2004.', 'author';
47 is $pp->get_abstract, 'Perl extension for blah blah blah', 'abstract';
51 # Try again without a valid author spec
53 tie *FH, 'IO::StringBased', <<'EOF';
56 Foo::Bar - Perl extension for blah blah blah
61 my $pp = Module::Build::PodParser->new(fh => \*FH);
62 ok $pp, 'object created';
64 is_deeply $pp->get_author, [], 'author';
65 is $pp->get_abstract, 'Perl extension for blah blah blah', 'abstract';