[libdist-zilla-plugin-test-eol-perl] 11/13: test the "filename" option
Intrigeri
intrigeri at moszumanska.debian.org
Sun Aug 16 09:20:35 UTC 2015
This is an automated email from the git hooks/post-receive script.
intrigeri pushed a commit to annotated tag 0.17
in repository libdist-zilla-plugin-test-eol-perl.
commit d146b359dbde9d654f48368b70fad0f3c77f5261
Author: Karen Etheridge <ether at cpan.org>
Date: Sat Jan 31 00:02:14 2015 -0800
test the "filename" option
---
t/04-filename.t | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 75 insertions(+)
diff --git a/t/04-filename.t b/t/04-filename.t
new file mode 100644
index 0000000..a91416c
--- /dev/null
+++ b/t/04-filename.t
@@ -0,0 +1,75 @@
+use strict;
+use warnings;
+
+use Test::More;
+use if $ENV{AUTHOR_TESTING}, 'Test::Warnings';
+use Test::DZil;
+use Path::Tiny;
+use Test::Deep;
+
+BEGIN {
+ use Dist::Zilla::Plugin::Test::EOL;
+ $Dist::Zilla::Plugin::Test::EOL::VERSION = 9999
+ unless $Dist::Zilla::Plugin::Test::EOL::VERSION;
+}
+
+my $tzil = Builder->from_config(
+ { dist_root => 't/does-not-exist' },
+ {
+ add_files => {
+ path(qw(source dist.ini)) => simple_ini(
+ [ GatherDir => ],
+ [ MetaConfig => ],
+ [ 'Test::EOL' => { filename => 'xt/release/foo.t' } ],
+ ),
+ path(qw(source lib Foo.pm)) => "package Foo;\n1\n",
+ },
+ },
+);
+
+$tzil->chrome->logger->set_debug(1);
+$tzil->build;
+
+my $build_dir = path($tzil->tempdir)->child('build');
+my $file = $build_dir->child(qw(xt release foo.t));
+ok( -e $file, 'test created, using the custom filename');
+
+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');
+
+cmp_deeply(
+ $tzil->distmeta,
+ superhashof({
+ prereqs => {
+ develop => {
+ requires => {
+ 'Test::More' => '0.88',
+ 'Test::EOL' => '0',
+ },
+ },
+ },
+ x_Dist_Zilla => superhashof({
+ plugins => supersetof(
+ {
+ class => 'Dist::Zilla::Plugin::Test::EOL',
+ config => {
+ 'Dist::Zilla::Plugin::Test::EOL' => {
+ finder => [ ':InstallModules', ':ExecFiles', ':TestFiles' ],
+ filename => 'xt/release/foo.t',
+ trailing_whitespace => 1,
+ },
+ },
+ name => 'Test::EOL',
+ version => ignore,
+ },
+ ),
+ }),
+ }),
+ 'prereqs are properly injected for the develop phase; dumped configs are good',
+) or diag 'got distmeta: ', explain $tzil->distmeta;
+
+diag 'got log messages: ', explain $tzil->log_messages
+ if not Test::Builder->new->is_passing;
+
+done_testing;
--
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