#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More tests => 12;
+use Test::More tests => 14;
use Test::Exception;
use MooseX::Role::Parameterized::Parameters;
is($parameter_metaclass->get_all_attributes, 1, "exactly one parameter");
my $parameter = ($parameter_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");
is($p->length, 5, "correct length");
+throws_ok {
+ $p->length(10);
+} qr/^Cannot assign a value to a read-only accessor/;
+
do {
package MyRole::LengthParameter;
use MooseX::Role::Parameterized;