From a0361cb57a3dcd9261d173f6d1add1b9c1c6064f Mon Sep 17 00:00:00 2001 From: Jonathan Rubin Date: Tue, 10 Jul 2018 17:21:22 -0400 Subject: [PATCH] Review Tweaks - take two Again per pull request #167, move some comments around, and better use Test::Warnings --- t/bugs/DEMOLISH_warnings.t | 8 +++++++- t/lib/Demolition/OnceRemoved.pm | 3 --- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/t/bugs/DEMOLISH_warnings.t b/t/bugs/DEMOLISH_warnings.t index 3a9de3ff9..bcb63cdf8 100644 --- a/t/bugs/DEMOLISH_warnings.t +++ b/t/bugs/DEMOLISH_warnings.t @@ -2,8 +2,14 @@ use strict; use warnings; use lib 't/lib'; -use Test::More tests => 2; # Test::Warnings re-tests had_no_warnings implicitly +use Test::More; use Test::Requires qw(Test::Warnings); +Test::Warnings->import(':no_end_test'); +# Demolition::OnceRemoved has a variable only in scope during the initial `use` +# As it leaves scope, Perl will call DESTROY on it +# (and Moose::Object will then go through its DEMOLISHALL method) use Demolition::OnceRemoved; Test::Warnings::had_no_warnings("No DEMOLISH warnings"); + +done_testing(); diff --git a/t/lib/Demolition/OnceRemoved.pm b/t/lib/Demolition/OnceRemoved.pm index c7f2e3b8f..8b52d126b 100644 --- a/t/lib/Demolition/OnceRemoved.pm +++ b/t/lib/Demolition/OnceRemoved.pm @@ -3,9 +3,6 @@ use strict; use warnings; use Demolition::Demolisher; -# This variable is only in scope during the initial `use` -# As it leaves scope, Perl will call DESTROY on it -# (and Moose::Object will then go through its DEMOLISHALL method) my $d = Demolition::Demolisher->new; 1;