Permalink
Browse files

Merge remote-tracking branch 'my/master'

Conflicts:
	Changes
	dist.ini
	lib/Dist/Zilla/Plugin/Test/PodSpelling.pm

Signed-off-by: Caleb Cushing <xenoterracide@gmail.com>
  • Loading branch information...
2 parents 0b28a81 + e0c647f commit 9dc78e577a5736cf9242473bd742712082fa16c0 @xenoterracide committed Apr 4, 2012
Showing with 60 additions and 5 deletions.
  1. +4 −0 Changes
  2. +1 −1 dist.ini
  3. +3 −1 lib/Dist/Zilla/Plugin/Test/PodSpelling.pm
  4. +3 −3 t/attributes.t
  5. +49 −0 t/dashed.t
View
@@ -5,6 +5,10 @@ Revision history for Perl extension {{$dist->name}}
2.002003 2012-04-04
- make tests required for authors but no one else
+2.002002 2012-03-07
+ - fix issue with a dash in the copyrigh holder GH #5
+ - use Test::Requires over eval
+
2.002001 2012-01-10
- fix copyright year
View
@@ -54,7 +54,7 @@ Pod::Wordlist::hanekomu = 0
[Git::CommitBuild]
[Git::NextVersion]
- first_version = 0.002000
+ first_version = 2
version_regexp = ^(.+)$
[CheckChangesHasContent]
@@ -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 );
View
@@ -37,14 +37,14 @@ sub get_content {
}
my $content = get_content({});
- like $content, qr/use Pod::Wordlist::hanekomu/, q[use default wordlist];
+ like $content, qr/Pod::Wordlist::hanekomu/, q[use default wordlist];
unlike $content, qr/set_spell_cmd/, q[by default don't set spell command];
like $content, qr/add_stopwords/, q[by default we add stopwords];
like $content, qr/__DATA__\s$author/, q[DATA handle includes author];
$content = get_content({wordlist => 'Foo::Bar'});
-unlike $content, qr/use Pod::Wordlist::hanekomu/, q[custom word list];
- like $content, qr/use Foo::Bar/, q[custom word list];
+unlike $content, qr/Pod::Wordlist::hanekomu/, q[custom word list];
+ like $content, qr/Foo::Bar/, q[custom word list];
$content = get_content({spell_cmd => 'all_wrong'});
like $content, qr/set_spell_cmd.+all_wrong/, q[custom spell checker];
View
@@ -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;

0 comments on commit 9dc78e5

Please sign in to comment.