use strict;
use warnings;
use Test::More;
{
package Foo;
use Moose;
use MooseX::MultiInitArg;
has foo => (
is => 'ro',
traits => ['MooseX::MultiInitArg::Trait'],
init_args => [qw( fu )],
);
# __PACKAGE__->meta->make_immutable;
}
sub check ($$)
{
my ($args, $name) = @_;
is(Foo->new(@$args)->foo, 42, $name);
}
check [foo => 42], 'mutable class; standard init arg';
check [fu => 42], 'mutable class; alternative init arg';
Foo->meta->make_immutable;
check [foo => 42], 'immutable class; standard init arg';
check [fu => 42], 'immutable class; alternative init arg';
done_testing;