[libdist-zilla-plugin-test-podspelling-perl] 02/07: add test for stopwords from contributors
Axel Beckert
abe at deuxchevaux.org
Mon May 25 10:04:35 UTC 2015
This is an automated email from the git hooks/post-receive script.
abe pushed a commit to annotated tag 2.006000
in repository libdist-zilla-plugin-test-podspelling-perl.
commit 46b6dce669ab383ad8ddc536005345055f1f29e1
Author: David Golden <dagolden at cpan.org>
Date: Tue Apr 30 10:40:33 2013 -0400
add test for stopwords from contributors
---
dist.ini | 2 ++
t/contributors.t | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 55 insertions(+)
diff --git a/dist.ini b/dist.ini
index 1e8ef2e..b595dd4 100644
--- a/dist.ini
+++ b/dist.ini
@@ -10,6 +10,8 @@ copyright_holder = Caleb Cushing
[Prereqs]
Pod::Wordlist::hanekomu = 0
Test::Spelling = 0.12
+[Prereqs / TestRequires]
+Dist::Zilla::Plugin::Meta::Contributors = 0
[ReadmeFromPod]
[@Filter]
diff --git a/t/contributors.t b/t/contributors.t
new file mode 100644
index 0000000..c6c3a32
--- /dev/null
+++ b/t/contributors.t
@@ -0,0 +1,53 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use Test::More 0.88;
+use Test::DZil;
+
+# test the file content generated gets contributor
+
+# contributor data
+my $fname = 'Mister';
+my $lname = 'Mxyzptlk';
+my $email = 'mr_mxyzptlk at example.com';
+
+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 => 'John Doe <jdoe at example.com>',
+ copyright_holder => 'John Doe <jdoe at example.com>'
+ },
+ [$name => $args],
+ ['Meta::Contributors',
+ {
+ contributor => ["$fname $lname <$email>"],
+ }
+ ],
+ )
+ }
+ }
+ );
+
+ my $plugin = $zilla->plugin_named($name);
+ $plugin->gather_files;
+ return $zilla->files->[0]->content;
+}
+
+my $content = get_content({});
+
+like $content, qr/$fname /xms, 'includes first name';
+like $content, qr/$lname/xms, 'includes last name';
+unlike $content, qr/$email/xms, 'includes email';
+
+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
More information about the Pkg-perl-cvs-commits
mailing list