X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F029-new.t;h=b8a615b029a1e22f90eb4f4c4547c08d27ba9de3;hb=0421f7e08cdd6c6ed5b8dd9435109c88070c23f8;hp=a14b570f78ca1b65ff08bc7c37d3cf2e608c983b;hpb=8c831d08b0d23c9dfcc4a85f6444915c988b5538;p=gitmo%2FMouse.git diff --git a/t/029-new.t b/t/029-new.t index a14b570..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 Mouse::Util ':test'; +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/;