4 use lib $ENV{PERL_CORE} ? '../lib/Module/Build/t/lib' : 't/lib';
10 #########################
12 use_ok 'Module::Build::PodParser';
15 package IO::StringBased;
18 my ($class, $string) = @_;
20 data => [ map "$_\n", split /\n/, $string],
25 shift @{ shift()->{data} };
30 tie *FH, 'IO::StringBased', <<'EOF';
33 Foo::Bar - Perl extension for blah blah blah
37 C<Foo::Bar> was written by Engelbert Humperdinck I<E<lt>eh@example.comE<gt>> in 2004.
39 Home page: http://example.com/~eh/
45 my $pp = Module::Build::PodParser->new(fh => \*FH);
46 ok $pp, 'object created';
48 is $pp->get_author->[0], 'C<Foo::Bar> was written by Engelbert Humperdinck I<E<lt>eh@example.comE<gt>> in 2004.', 'author';
49 is $pp->get_abstract, 'Perl extension for blah blah blah', 'abstract';
53 # Try again without a valid author spec
55 tie *FH, 'IO::StringBased', <<'EOF';
58 Foo::Bar - Perl extension for blah blah blah
63 my $pp = Module::Build::PodParser->new(fh => \*FH);
64 ok $pp, 'object created';
66 is_deeply $pp->get_author, [], 'author';
67 is $pp->get_abstract, 'Perl extension for blah blah blah', 'abstract';