X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F029-new.t;h=b8a615b029a1e22f90eb4f4c4547c08d27ba9de3;hb=4dd75d5701a927ee1e6aa1b2d3c765ae0545b8e8;hp=9ad1721523e1fe4badab23dd4c93cc040ec6954b;hpb=39d3892835648e27207ffb598b1d55799007c376;p=gitmo%2FMouse.git diff --git a/t/029-new.t b/t/029-new.t index 9ad1721..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 => 4; +use Test::More tests => 7; use Test::Exception; do { package Class; use Mouse; - has 'x'; + has x => ( + is => 'bare', + ); has y => ( is => 'ro', @@ -28,3 +30,16 @@ 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/; + +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/;