requires 'Moose' => '0.82';
+build_requires 'Scalar::Util';
build_requires 'Test::More';
build_requires 'Test::Exception';
use strict;
use warnings;
+use Scalar::Util qw( refaddr );
use Test::More;
BEGIN {
plan skip_all => 'These tests require Test::Warn';
}
else {
- plan tests => 17;
+ plan tests => 18;
}
}
is($mst2->distinct_keys, 0, "Package->clear works");
is(MooseX::Singleton::Test->distinct_keys, 0, "Package->clear works");
+{
+ my $addr;
+
+ {
+ $addr = refaddr( MooseX::Singleton::Test->instance );
+ }
+
+ is( $addr, refaddr( MooseX::Singleton::Test->instance ),
+ 'singleton is not randomly destroyed' );
+}
+