Small refactoring to simplify generating code a bit
[gitmo/Moose.git] / t / 010_basics / 020-global-destruction.t
CommitLineData
9a7f2b2d 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use Test::More tests => 2;
7
61c4a4cd 8{
9 package Foo;
10 use Moose;
9a7f2b2d 11
61c4a4cd 12 sub DEMOLISH {
13 my $self = shift;
14 my ($igd) = @_;
15 ::ok(
16 !$igd,
17 'in_global_destruction state is passed to DEMOLISH properly (false)'
18 );
19 }
9a7f2b2d 20}
21
9a7f2b2d 22{
23 my $foo = Foo->new;
24}
61c4a4cd 25
26my $igd = `$^X t/010_basics/020-global-destruction-helper.pl`;
27ok( $igd,
28 'in_global_destruction state is passed to DEMOLISH properly (true)' );