X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F029-new.t;h=b8a615b029a1e22f90eb4f4c4547c08d27ba9de3;hb=f9aca0f35658e5e0657e8ce78b783c0185d59969;hp=d387bdf01d44c5d245ef3ea894cd13b185fe5d21;hpb=eab815459cfd4be951f1f44cd656e76169f7a1d6;p=gitmo%2FMouse.git diff --git a/t/029-new.t b/t/029-new.t index d387bdf..b8a615b 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([]); +} qr/Single parameters to new\(\) must be a HASH ref/; + +throws_ok { + Class->new(Class->new); +} qr/Single parameters to new\(\) must be a HASH ref/;