[libdist-zilla-plugin-test-eol-perl] 02/05: also test the deprecation warning in [EOLTests]

Intrigeri intrigeri at moszumanska.debian.org
Sun Aug 16 09:20:24 UTC 2015


This is an automated email from the git hooks/post-receive script.

intrigeri pushed a commit to annotated tag 0.15
in repository libdist-zilla-plugin-test-eol-perl.

commit 82e953458d04389e4144e671ff71754600c9c817
Author: Karen Etheridge <ether at cpan.org>
Date:   Thu Oct 30 19:53:29 2014 -0700

    also test the deprecation warning in [EOLTests]
---
 t/01-basic.t    |  3 ++-
 t/02-eoltests.t | 18 +++++++++++++++++-
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/t/01-basic.t b/t/01-basic.t
index 7a9f5b1..b78ea37 100644
--- a/t/01-basic.t
+++ b/t/01-basic.t
@@ -2,7 +2,7 @@ use strict;
 use warnings FATAL => 'all';
 
 use Test::More;
-use if $ENV{AUTHOR_TESTING}, 'Test::Warnings';
+use Test::Warnings 0.009 ':no_end_test', ':all';
 use Test::DZil;
 use Path::Tiny;
 use File::pushd 'pushd';
@@ -86,4 +86,5 @@ is($files_tested, 2, 'correct number of files were tested');
 diag 'got log messages: ', explain $tzil->log_messages
     if not Test::Builder->new->is_passing;
 
+had_no_warnings if $ENV{AUTHOR_TESTING};
 done_testing;
diff --git a/t/02-eoltests.t b/t/02-eoltests.t
index bf1af4b..b74e926 100644
--- a/t/02-eoltests.t
+++ b/t/02-eoltests.t
@@ -6,9 +6,25 @@ use warnings FATAL => 'all';
 use Path::Tiny;
 my $code = path('t', '01-basic.t')->slurp_utf8;
 
-$code =~ s/use if \$ENV\{AUTHOR_TESTING\}, 'Test::Warnings';//;
+my $begin_warnings = <<'END';
+my @warnings = warnings {
+END
+
+my $end_warnings = <<'END';
+};  # end warnings capture
+
+cmp_deeply(
+    \@warnings,
+    [ re(qr/^\Q!!! [EOLTests] is deprecated and may be removed in a future release; replace it with [Test::EOL] (note the different default filename)\E/) ],
+    'deprecation warning was seen',
+);
+END
+
 $code =~ s/Test::EOL(?!'\s*=>)/EOLTests/g;
 $code =~ s{xt(.)author(.)eol\.t}{xt$1release$2eol.t}g;
 
+$code =~ s/^(my \$tzil = .*\n)/$begin_warnings\n$1/m;
+$code =~ s/had_no_warnings/$end_warnings\nhad_no_warnings/;
+
 eval $code;
 die $@ if $@;

-- 
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