7 blib_load('Module::Build::PodParser');
9 #########################
12 package IO::StringBased;
15 my ($class, $string) = @_;
17 data => [ map "$_\n", split /\n/, $string],
22 shift @{ shift()->{data} };
27 tie *FH, 'IO::StringBased', <<'EOF';
30 Foo::Bar - Perl extension for blah blah blah
34 C<Foo::Bar> was written by Engelbert Humperdinck I<E<lt>eh@example.comE<gt>> in 2004.
36 Home page: http://example.com/~eh/
42 my $pp = Module::Build::PodParser->new(fh => \*FH);
43 ok $pp, 'object created';
45 is $pp->get_author->[0], 'C<Foo::Bar> was written by Engelbert Humperdinck I<E<lt>eh@example.comE<gt>> in 2004.', 'author';
46 is $pp->get_abstract, 'Perl extension for blah blah blah', 'abstract';
50 # Try again without a valid author spec
52 tie *FH, 'IO::StringBased', <<'EOF';
55 Foo::Bar - Perl extension for blah blah blah
60 my $pp = Module::Build::PodParser->new(fh => \*FH);
61 ok $pp, 'object created';
63 is_deeply $pp->get_author, [], 'author';
64 is $pp->get_abstract, 'Perl extension for blah blah blah', 'abstract';
69 # Try again with mixed-case =head1s.
71 tie *FH, 'IO::StringBased', <<'EOF';
74 Foo::Bar - Perl extension for blah blah blah
78 C<Foo::Bar> was written by Engelbert Humperdinck I<E<lt>eh@example.comE<gt>> in 2004.
80 Home page: http://example.com/~eh/
85 my $pp = Module::Build::PodParser->new(fh => \*FH);
86 ok $pp, 'object created';
88 is $pp->get_author->[0], 'C<Foo::Bar> was written by Engelbert Humperdinck I<E<lt>eh@example.comE<gt>> in 2004.', 'author';
89 is $pp->get_abstract, 'Perl extension for blah blah blah', 'abstract';