X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F022-init-arg.t;h=9546e3dfc42f8c391eedf7493776e7e551b52c44;hb=faa45e546ff56d48fbd9fec43d1fc014520ca0e3;hp=07c221d7bcb46226817c7df5bd7b90971f78b71c;hpb=1f679986b3a35589752bf63107265b455605bc45;p=gitmo%2FMouse.git diff --git a/t/022-init-arg.t b/t/022-init-arg.t index 07c221d..9546e3d 100644 --- a/t/022-init-arg.t +++ b/t/022-init-arg.t @@ -1,7 +1,7 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 10; +use Test::More tests => 11; do { package Class; @@ -9,6 +9,7 @@ do { has name => ( is => 'rw', + isa => 'Str', init_arg => 'key', default => 'default', ); @@ -43,3 +44,7 @@ do { my $foo = Foo->new(name => 'joe'); is($foo->name, 'default', 'init_arg => undef ignores attribute name in the constructor'); +Foo->meta->make_immutable; + +my $bar = Foo->new(name => 'joe'); +is($bar->name, 'default', 'init_arg => undef ignores attribute name in the inlined constructor');