This is an automated email from the git hooks/post-receive script. abe pushed a commit to annotated tag 2.002002 in repository libdist-zilla-plugin-test-podspelling-perl.
commit ff66c1614fc10b1014e4090b47ea7902183834df Author: Caleb Cushing <xenoterrac...@gmail.com> Date: Wed Mar 7 12:42:03 2012 -0600 fix problem with - in copyright holder GH #5 Signed-off-by: Caleb Cushing <xenoterrac...@gmail.com> --- lib/Dist/Zilla/Plugin/Test/PodSpelling.pm | 4 ++- t/dashed.t | 49 +++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/lib/Dist/Zilla/Plugin/Test/PodSpelling.pm b/lib/Dist/Zilla/Plugin/Test/PodSpelling.pm index 3ec482e..349e7a9 100644 --- a/lib/Dist/Zilla/Plugin/Test/PodSpelling.pm +++ b/lib/Dist/Zilla/Plugin/Test/PodSpelling.pm @@ -56,7 +56,9 @@ around add_file => sub { if ( $self->zilla->copyright_holder ) { for ( split( ' ', $self->zilla->copyright_holder ) ) { - my ( $word ) = $_ =~ /(\w+)/xms; + my ( $word ) = $_ =~ /(\w{2,})/xms; + + next unless $word; $self->log_debug( 'copyright_holder word: ' . $word ); diff --git a/t/dashed.t b/t/dashed.t new file mode 100644 index 0000000..0975082 --- /dev/null +++ b/t/dashed.t @@ -0,0 +1,49 @@ +#!/usr/bin/perl +use strict; +use warnings; +use Test::More 0.88; +use Test::DZil; + +# test the file content generated when various attributes are set + +my $fname = 'Fo'; +my $mi = 'G'; +my $lname1 = 'oer'; +my $lname2 = 'bar'; +my $author = "$fname $mi $lname1 - $lname2"; + +sub get_content { + my ($args) = @_; + + my $name = 'Test::PodSpelling'; + my $zilla = Builder->from_config( + { dist_root => 'corpus/foo' }, + { + add_files => { + 'source/dist.ini' => dist_ini( + { + name => 'Spell-Checked', + version => 1, + abstract => 'spelled wrong', + license => 'Perl_5', + author => $author, + copyright_holder => $author, + }, + [$name => $args], + ) + } + } + ); + + my $plugin = $zilla->plugin_named($name); + $plugin->gather_files; + return $zilla->files->[0]->content; +} + +my $content = get_content({}); +like $content, qr/^$fname $/xms, q[includes first name]; +like $content, qr/^$lname1$/xms, q[includes last name 1]; +like $content, qr/^$lname2$/xms, q[includes last name 2]; +unlike $content, qr/^$mi $/xms, q[doesnot include the midddle initial]; + +done_testing; -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libdist-zilla-plugin-test-podspelling-perl.git _______________________________________________ Pkg-perl-cvs-commits mailing list Pkg-perl-cvs-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits