X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Singleton.git;a=blobdiff_plain;f=t%2F002-init.t;h=8b5f14406b016def63cf44df40ba5fa2a4da1dd1;hp=2c2589756310fc5af7b4b915994f618fea138cf4;hb=d928ce3a26634463da667f6bdba903e94b31ebac;hpb=d64d58118b49361e1accb6c0371631150cc6df06 diff --git a/t/002-init.t b/t/002-init.t index 2c25897..8b5f144 100644 --- a/t/002-init.t +++ b/t/002-init.t @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::More tests => 8; +use Test::More tests => 9; my $i = 0; sub new_singleton_pkg { @@ -42,11 +42,14 @@ for my $pkg (new_singleton_pkg) { ); eval { $pkg->new(number => 3) }; - ok($@, "can't make new singleton with conflicting attributes"); + like($@, qr/already/, "can't make new singleton with conflicting attributes"); my $second = eval { $pkg->new }; ok(!$@, "...but a second ->new without args is okay"); is($second->number, 5, "...we get the originally inited number from it"); + + eval { $pkg->initialize }; + like($@, qr/already/, "...but ->initialize() is still an error"); }