X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F029-new.t;fp=t%2F029-new.t;h=4e642ebae5fabbe6bd8462a49d242cfabe961d8c;hb=c9aefe2628c559c55abe2ddc8de6c92a5d9dbbaf;hp=d387bdf01d44c5d245ef3ea894cd13b185fe5d21;hpb=2a902f4c890810af78190b630d4622b610ad19e8;p=gitmo%2FMouse.git diff --git a/t/029-new.t b/t/029-new.t index d387bdf..4e642eb 100644 --- a/t/029-new.t +++ b/t/029-new.t @@ -1,7 +1,7 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 5; +use Test::More tests => 7; use Test::Exception; do { @@ -28,7 +28,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/;