X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-StrictConstructor.git;a=blobdiff_plain;f=t%2Fbasic.t;fp=t%2Fbasic.t;h=b159e77f769d51ed16191debcf471da597eb52e0;hp=f69201fc803275db2655ba64e3726ad2f0dd8592;hb=4a070866bc7b2cf1792322865e0c7997ef7401a3;hpb=1d825f19429728e99dcdfbedac344c299433e3dc diff --git a/t/basic.t b/t/basic.t index f69201f..b159e77 100644 --- a/t/basic.t +++ b/t/basic.t @@ -80,6 +80,26 @@ use Test::More; has 'size' => ( is => 'rw', 'init_arg' => undef ); } +{ + local $@; + eval q[package MyRole; use Moose::Role; use MooseX::StrictConstructor;]; + like( + $@, + qr/can only be applied to Moose classes/, + "can't apply MXSC to a role" + ); +} + +{ + local $@; + eval q[package Nothing; use MooseX::StrictConstructor;]; + like( + $@, + qr/can only be applied to Moose classes/, + "can't apply MXSC to a random package", + ); +} + my @classes = qw( Standard Stricter Subclass StrictSubclass OtherStrictSubclass Tricky InitArg );