isa checks on builders
[gitmo/Moo.git] / t / demolish-global_destruction.t
CommitLineData
c2cc003f 1
2use strictures 1;
3use Test::More;
4use Test::Fatal;
5
6{
7 package Foo;
8 use Moo;
9
10 sub DEMOLISH {
11 my $self = shift;
12 my ($igd) = @_;
13 ::ok(
14 !$igd,
15 'in_global_destruction state is passed to DEMOLISH properly (false)'
16 );
17 }
18}
19
20{
21 my $foo = Foo->new;
22}
23
75e99e0b 24chomp(my $out = `$^X t/global-destruction-helper.pl`);
25
26is(
27 $out, 'true',
c2cc003f 28 'in_global_destruction state is passed to DEMOLISH properly (true)'
75e99e0b 29);
c2cc003f 30
31done_testing;