#!/usr/bin/env perl
use strict;
use warnings;
-use Test::More tests => 5;
+use Test::More tests => 7;
use Test::Exception;
my ($parameters, %args);
is => 'ro',
default => $parameters->default_age,
);
+
+ method birthday => sub {
+ my $self = shift;
+ return 2000 - $self->age;
+ };
};
};
my $age_attr = $role->get_attribute('age');
is($age_attr->{default}, 7, "role's age attribute has the right default");
+my $birthday_method = $role->get_method('birthday');
+is($birthday_method->name, 'birthday', "method name");
+is($birthday_method->package_name, 'MyPerson', "package name");