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