Created
March 19, 2009 23:55
-
-
Save osfameron/82135 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
#!/usr/bin/perl | |
use strict; use warnings; | |
package Parent; | |
use Moose; | |
use MooseX::ClassAttribute; | |
class_has attr => ( | |
isa => 'Str', | |
is => 'rw', | |
); | |
package Child; | |
use Moose; | |
extends 'Parent'; | |
package main; | |
use Test::More tests=>3; | |
Parent->attr('Red'); | |
is (Parent->attr, 'Red', "parent attribute set" ); | |
Child->attr("Blue"); | |
is (Child ->attr, 'Blue', "child attribute set" ); | |
is (Parent->attr, 'Red', "parent attribute untouched" ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment