Skip to content

Commit

Permalink
Review Tweaks - take two
Browse files Browse the repository at this point in the history
Again per pull request #167, move some comments around, and better use
Test::Warnings
  • Loading branch information
jrubinator committed Jul 10, 2018
1 parent 1f0ebe4 commit a0361cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 7 additions & 1 deletion t/bugs/DEMOLISH_warnings.t
Original file line number Diff line number Diff line change
Expand Up @@ -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();
3 changes: 0 additions & 3 deletions t/lib/Demolition/OnceRemoved.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit a0361cb

Please sign in to comment.