Skip to content

Instantly share code, notes, and snippets.

@osfameron
Created March 19, 2009 23:55
Show Gist options
  • Save osfameron/82135 to your computer and use it in GitHub Desktop.
Save osfameron/82135 to your computer and use it in GitHub Desktop.
#!/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