-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Topic/demolish warnings #167
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use strict; | ||
use warnings; | ||
|
||
use lib 't/lib'; | ||
use Test::More; | ||
use Test::Requires qw(Test::Warnings); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think if you add |
||
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(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package Demolition::Demolisher; | ||
use Moose; | ||
|
||
sub DEMOLISH { } | ||
|
||
1; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package Demolition::OnceRemoved; | ||
use strict; | ||
use warnings; | ||
use Demolition::Demolisher; | ||
|
||
my $d = Demolition::Demolisher->new; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we move this into a block in the |
||
|
||
1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A comment explaining why this is necessary would be good.