X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Singleton.git;a=blobdiff_plain;f=t%2F006-cooperative.t;h=4d6d832fa6d3fd0cbcaab7e7685c610b3e6bec79;hp=ed5d2c09e23801b954209a244ef495f650a2a55e;hb=442716939904bc62fd04afc200f9c8afc901974c;hpb=4c25692312665e52f72b16a0a3086046590cf46a diff --git a/t/006-cooperative.t b/t/006-cooperative.t index ed5d2c0..4d6d832 100644 --- a/t/006-cooperative.t +++ b/t/006-cooperative.t @@ -3,14 +3,10 @@ use warnings; use Test::More; -BEGIN { - eval "require MooseX::StrictConstructor; use Test::Exception; 1;"; - plan skip_all => - 'This test requires MooseX::StrictConstructor and Test::Exception' - if $@; -} - -plan 'no_plan'; +use Test::Requires { + 'MooseX::StrictConstructor' => 0.16, + 'Test::Fatal' => 0.001, +}; { package MySingleton; @@ -18,10 +14,12 @@ plan 'no_plan'; use MooseX::Singleton; use MooseX::StrictConstructor; - has 'attrib' => is => 'rw'; + has 'attrib' => ( is => 'rw' ); } -throws_ok { +like( exception { MySingleton->new( bad_name => 42 ); -} -qr/Found unknown attribute/, 'singleton class also has a strict constructor'; +}, +qr/Found unknown attribute/, 'singleton class also has a strict constructor'); + +done_testing;