X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F029-new.t;h=fe660a1f52caa8da09fdd93eadeccc4199c10f96;hb=11d415286701d3b51e517cb6826138808967cb89;hp=d387bdf01d44c5d245ef3ea894cd13b185fe5d21;hpb=069668c4fbc88fc3a347c4dbab98f031835edb75;p=gitmo%2FMouse.git diff --git a/t/029-new.t b/t/029-new.t index d387bdf..fe660a1 100644 --- a/t/029-new.t +++ b/t/029-new.t @@ -1,14 +1,16 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 5; +use Test::More tests => 7; use Test::Exception; do { package Class; use Mouse; - has 'x'; + has x => ( + is => 'bare', + ); has y => ( is => 'ro', @@ -28,7 +30,16 @@ throws_ok { Class->new('non-hashref scalar'); } qr/Single parameters to new\(\) must be a HASH ref/; -lives_ok { +throws_ok { Class->new(undef); -} "Class->new(undef) specifically doesn't throw an error. weird" +} qr/Single parameters to new\(\) must be a HASH ref/; +Class->meta->make_immutable; + +throws_ok { + Class->new('non-hashref scalar'); +} qr/Single parameters to new\(\) must be a HASH ref/; + +throws_ok { + Class->new(undef); +} qr/Single parameters to new\(\) must be a HASH ref/;