[libdist-zilla-plugin-test-eol-perl] 09/18: inject Test::EOL as a develop prerequisite
Intrigeri
intrigeri at moszumanska.debian.org
Sun Aug 16 09:20:13 UTC 2015
This is an automated email from the git hooks/post-receive script.
intrigeri pushed a commit to annotated tag 0.13
in repository libdist-zilla-plugin-test-eol-perl.
commit a4451956ad10564cc4f972e869b6b76c14ab0948
Author: Karen Etheridge <ether at cpan.org>
Date: Sun Oct 12 16:50:41 2014 -0700
inject Test::EOL as a develop prerequisite
---
Changes | 1 +
lib/Dist/Zilla/Plugin/Test/EOL.pm | 16 +++++++++++++++-
perlcritic.rc | 3 +++
t/01-basic.t | 16 +++++++++++++++-
4 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/Changes b/Changes
index a882580..d097f3a 100644
--- a/Changes
+++ b/Changes
@@ -4,6 +4,7 @@ Revision history for {{$dist->name}}
- Dist::Zilla::Plugin::EOLTests and Dist::Zilla::Plugin::Test::EOL are
now combined into one distribution, Dist-Zilla-Plugin-Test-EOL
- add "filename" configuration option
+ - Test::EOL is injected as a develop prerequisite
0.12 2014-04-10
- readd Test::EOL prereq that was accidentally removed when moving to
diff --git a/lib/Dist/Zilla/Plugin/Test/EOL.pm b/lib/Dist/Zilla/Plugin/Test/EOL.pm
index a3c29ef..86e9804 100644
--- a/lib/Dist/Zilla/Plugin/Test/EOL.pm
+++ b/lib/Dist/Zilla/Plugin/Test/EOL.pm
@@ -10,6 +10,7 @@ use namespace::autoclean;
with
'Dist::Zilla::Role::FileGatherer',
'Dist::Zilla::Role::TextTemplate',
+ 'Dist::Zilla::Role::PrereqSource',
;
has trailing_whitespace => (
@@ -47,6 +48,19 @@ sub gather_files
return;
}
+sub register_prereqs
+{
+ my $self = shift;
+ $self->zilla->register_prereqs(
+ {
+ type => 'requires',
+ phase => 'develop',
+ },
+ 'Test::More' => 0,
+ 'Test::EOL' => 0,
+ );
+}
+
__PACKAGE__->meta->make_immutable;
1;
@@ -81,7 +95,7 @@ the end of the lines (also known as "trailing space").
The filename of the test to add - defaults to F<xt/author/test-eol.t>.
-=for Pod::Coverage gather_files
+=for Pod::Coverage gather_files register_prereqs
=head1 ACKNOWLEDGMENTS
diff --git a/perlcritic.rc b/perlcritic.rc
index 541d009..392ffd7 100644
--- a/perlcritic.rc
+++ b/perlcritic.rc
@@ -1,2 +1,5 @@
severity = 3
verbose = 9
+
+## Turn these off
+[-Subroutines::RequireFinalReturn]
diff --git a/t/01-basic.t b/t/01-basic.t
index e13ec3d..977097c 100644
--- a/t/01-basic.t
+++ b/t/01-basic.t
@@ -38,7 +38,21 @@ my $content = $file->slurp_utf8;
unlike($content, qr/[^\S\n]\n/m, 'no trailing whitespace in generated test');
unlike($content, qr/\t/m, 'no tabs in generated test');
-# TODO: check distmeta
+cmp_deeply(
+ $tzil->distmeta,
+ superhashof({
+ prereqs => {
+ develop => {
+ requires => {
+ 'Test::More' => '0',
+ 'Test::EOL' => '0',
+ },
+ },
+ },
+ # TODO: x_Dist_Zilla
+ }),
+ 'prereqs are properly injected for the develop phase',
+) or diag 'got distmeta: ', explain $tzil->distmeta;
my $files_tested;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libdist-zilla-plugin-test-eol-perl.git
More information about the Pkg-perl-cvs-commits
mailing list