X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F002-init.t;h=8b5f14406b016def63cf44df40ba5fa2a4da1dd1;hb=ade9ece08d09a5a858e7978a970831f0f65ac3a4;hp=2c2589756310fc5af7b4b915994f618fea138cf4;hpb=1de95613f2dfae86af1a8f548d66d1de842e7201;p=gitmo%2FMooseX-Singleton.git 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"); }