Created
December 22, 2010 14:01
-
-
Save dams/751539 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
package Person::Child; | |
use base 'Person'; | |
__PACKAGE__->attributes('parent'); | |
} | |
my $child = Person::Child->new(); | |
ok $child->parent($p), 'setting parent'; | |
ok $child->name('bob'), 'setting child name'; | |
ok $child->age(5), 'setting child age'; | |
is $child->age, 5, 'age is ok'; | |
is $child->parent->sex, 'male', 'age is ok'; | |
my $child_attrs = Person::Child->get_attributes(); | |
is_deeply $child_attrs, ['parent', 'name', 'age', 'sex'], "attributes are ok"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment