[Moose-commits] r7330 - in MooseX-Role-Parameterized/trunk:
lib/MooseX/Role/Parameterized/Meta/Role t
sartak at code2.0beta.co.uk
sartak at code2.0beta.co.uk
Sun Jan 18 02:46:32 GMT 2009
Author: sartak
Date: 2009-01-17 18:46:31 -0800 (Sat, 17 Jan 2009)
New Revision: 7330
Modified:
MooseX-Role-Parameterized/trunk/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm
MooseX-Role-Parameterized/trunk/t/001-parameters.t
Log:
Rename parameter_metaclass to parameters_metaclass
Modified: MooseX-Role-Parameterized/trunk/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm
===================================================================
--- MooseX-Role-Parameterized/trunk/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm 2009-01-18 02:35:56 UTC (rev 7329)
+++ MooseX-Role-Parameterized/trunk/lib/MooseX/Role/Parameterized/Meta/Role/Parameterizable.pm 2009-01-18 02:46:31 UTC (rev 7330)
@@ -7,7 +7,7 @@
use constant parameterized_role_metaclass => 'MooseX::Role::Parameterized::Meta::Role::Parameterized';
-has parameter_metaclass => (
+has parameters_metaclass => (
is => 'rw',
isa => 'Moose::Meta::Class',
lazy => 1,
@@ -36,7 +36,7 @@
if $name eq 'alias'
|| $name eq 'excludes';
- $self->parameter_metaclass->add_attribute($name => @_);
+ $self->parameters_metaclass->add_attribute($name => @_);
}
sub construct_parameters {
@@ -49,7 +49,7 @@
if exists $args{$name};
}
- $self->parameter_metaclass->new_object(\%args);
+ $self->parameters_metaclass->new_object(\%args);
}
sub generate_role {
Modified: MooseX-Role-Parameterized/trunk/t/001-parameters.t
===================================================================
--- MooseX-Role-Parameterized/trunk/t/001-parameters.t 2009-01-18 02:35:56 UTC (rev 7329)
+++ MooseX-Role-Parameterized/trunk/t/001-parameters.t 2009-01-18 02:46:31 UTC (rev 7330)
@@ -14,8 +14,8 @@
use MooseX::Role::Parameterized;
};
-my $parameter_metaclass = MyRole::NoParameters->meta->parameter_metaclass;
-is($parameter_metaclass->get_all_attributes, 0, "no parameters");
+my $parameters_metaclass = MyRole::NoParameters->meta->parameters_metaclass;
+is($parameters_metaclass->get_all_attributes, 0, "no parameters");
do {
package MyRole::LengthParameter;
@@ -28,10 +28,10 @@
);
};
-$parameter_metaclass = MyRole::LengthParameter->meta->parameter_metaclass;
-is($parameter_metaclass->get_all_attributes, 1, "exactly one parameter");
+$parameters_metaclass = MyRole::LengthParameter->meta->parameters_metaclass;
+is($parameters_metaclass->get_all_attributes, 1, "exactly one parameter");
-my $parameter = ($parameter_metaclass->get_all_attributes)[0];
+my $parameter = ($parameters_metaclass->get_all_attributes)[0];
isa_ok($parameter, 'MooseX::Role::Parameterized::Meta::Parameter');
is($parameter->name, 'length', "parameter name");
ok($parameter->is_required, "parameter is required");
@@ -60,11 +60,11 @@
);
};
-$parameter_metaclass = MyRole::LengthParameter->meta->parameter_metaclass;
-is($parameter_metaclass->get_all_attributes, 3, "three parameters");
+$parameters_metaclass = MyRole::LengthParameter->meta->parameters_metaclass;
+is($parameters_metaclass->get_all_attributes, 3, "three parameters");
for my $param_name ('first_name', 'last_name') {
- my $param = $parameter_metaclass->get_attribute($param_name);
+ my $param = $parameters_metaclass->get_attribute($param_name);
is($param->type_constraint, 'Str', "$param_name type constraint");
ok(!$param->is_required, "$param_name is optional");
}
More information about the Moose-commits
mailing list