7706f4a71ae80653082f19309a5cdac28ce10359
[gitmo/Mouse.git] / t / 030-has-plus.t
1 #!/usr/bin/env perl
2 use strict;
3 use warnings;
4 use Test::More tests => 2;
5
6 do {
7     package Class;
8     use Mouse;
9
10     has attr => (
11         is  => 'rw',
12         isa => 'Bool',
13     );
14
15     package Child;
16     use Mouse;
17     extends 'Class';
18
19     has '+attr' => (
20         default => 1,
21     );
22 };
23
24 my $obj = Class->new;
25 ok(!$obj->attr, 'has + does not affect the superclass');
26
27 my $obj2 = Child->new;
28 ok($obj2->attr, 'has + combines child attribute with parent');
29