Class-Observable

 view release on metacpan or  search on metacpan

t/threads.t  view on Meta::CPAN

is_deeply( threads->create( sub { [ $self->get_observers ] } )->join, \@obs,
	'got expected observers in cloned interpreter' );

$self->delete_all_observers; # clean up manually
undef $self;
is( threads->create( sub { $warning } )->join, undef,
	'manual cleanup prevents lost instances' );

$self = bless {};
$self->add_observer( @obs );
undef $self; # no cleanup, rely on DESTROY (which is blocked), causing littering
is( threads->create( sub { $warning } )->join,
	"*** Inconsistent state ***\nObserved instances have gone away without invoking Class::Observable::DESTROY\n",
	'detected lost instances' );



( run in 0.474 second using v1.01-cache-2.11-cpan-49f99fa48dc )