From: Shawn M Moore Date: Sun, 15 Jun 2008 18:34:46 +0000 (+0000) Subject: Begin adding tests for has +foo X-Git-Tag: 0.04~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7e2909e58c70dfb258ca1d10b334eaa6d8422852;p=gitmo%2FMouse.git Begin adding tests for has +foo --- diff --git a/t/030-has-plus.t b/t/030-has-plus.t new file mode 100644 index 0000000..7706f4a --- /dev/null +++ b/t/030-has-plus.t @@ -0,0 +1,29 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More tests => 2; + +do { + package Class; + use Mouse; + + has attr => ( + is => 'rw', + isa => 'Bool', + ); + + package Child; + use Mouse; + extends 'Class'; + + has '+attr' => ( + default => 1, + ); +}; + +my $obj = Class->new; +ok(!$obj->attr, 'has + does not affect the superclass'); + +my $obj2 = Child->new; +ok($obj2->attr, 'has + combines child attribute with parent'); +