);
my %modules = reverse @modules;
-plan tests => 52 + 2 * keys( %modules );
+plan tests => 54 + 2 * keys( %modules );
require_ok('Module::Metadata');
Simple Simon
+You can find me on the IRC channel
+#simon on irc.perl.org.
+
=cut
---
$dist->regen;
}
$pod{$section} = $content;
}
- is( $pod{NAME}, q|Simple - It's easy.|, 'collected NAME pod section' );
- is( $pod{AUTHOR}, q|Simple Simon|, 'collected AUTHOR pod section' );
+ my %expected = (
+ NAME => q|Simple - It's easy.|,
+ AUTHOR => <<'EXPECTED'
+Simple Simon
+
+You can find me on the IRC channel
+#simon on irc.perl.org.
+EXPECTED
+ );
+ for my $text (values %expected) {
+ $text =~ s/^\s+//;
+ $text =~ s/\s+$//;
+ }
+ is( $pod{NAME}, $expected{NAME}, 'collected NAME pod section' );
+ is( $pod{AUTHOR}, $expected{AUTHOR}, 'collected AUTHOR pod section' );
+}
+
+{
+ # test things that look like POD, but aren't
+$dist->change_file( 'lib/Simple.pm', <<'---' );
+package Simple;
+sub podzol () { 1 }
+sub cute () { 2 }
+my $x
+=podzol
+;
+
+our $VERSION = '1.23';
+
+my $y
+=cute
+;
+
+our $VERSION = '999';
+
+---
+ $dist->regen;
+ $pm_info = Module::Metadata->new_from_file('lib/Simple.pm');
+ is( $pm_info->name, 'Simple', 'found default package' );
+ is( $pm_info->version, '1.23', 'version for default package' );
}
{