From: Shawn M Moore Date: Wed, 11 Jun 2008 11:03:42 +0000 (+0000) Subject: Test that subclassing looks at the superclass' attributes in the constructor (it... X-Git-Tag: 0.04~21 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=36062241ac10535c2ce8e77143c9076e0595bf81;p=gitmo%2FMouse.git Test that subclassing looks at the superclass' attributes in the constructor (it doesn't!) --- diff --git a/t/028-subclass-attr.t b/t/028-subclass-attr.t new file mode 100644 index 0000000..527e048 --- /dev/null +++ b/t/028-subclass-attr.t @@ -0,0 +1,27 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More tests => 2; + +do { + package Class; + use Mouse; + + has class => ( + is => 'rw', + isa => 'Bool', + ); + + package Child; + use Mouse; + extends 'Class'; + + has child => ( + is => 'rw', + isa => 'Bool', + ); +}; + +my $obj = Child->new(class => 1, child => 1); +ok($obj->child, "local attribute set in constructor"); +ok($obj->class, "inherited attribute set in constructor");