Commit | Line | Data |
---|---|---|
41888e7d | 1 | #!/usr/bin/env perl |
2 | ||
3 | use strict; | |
4 | use warnings; | |
8aba926d | 5 | use Test::More; |
6 | ||
7 | BEGIN{ | |
8 | if($] < 5.008){ | |
9 | plan skip_all => "segv happens on 5.6.2"; | |
10 | } | |
11 | } | |
41888e7d | 12 | |
13 | use Test::More tests => 4; | |
14 | use Test::Exception; | |
15 | ||
16 | { | |
17 | package NoOpTrait; | |
18 | use Mouse::Role; | |
8aba926d | 19 | |
20 | ||
41888e7d | 21 | } |
22 | ||
23 | { | |
24 | package Parent; | |
8aba926d | 25 | use Mouse "-traits" => 'NoOpTrait'; |
41888e7d | 26 | |
27 | has attr => ( | |
28 | is => 'rw', | |
29 | isa => 'Str', | |
30 | ); | |
31 | } | |
32 | ||
33 | { | |
34 | package Child; | |
35 | use base 'Parent'; | |
36 | } | |
41888e7d | 37 | is(Child->meta->name, 'Child', "correct metaclass name"); |
41888e7d | 38 | my $child = Child->new(attr => "ibute"); |
39 | ok($child, "constructor works"); | |
40 | ||
8aba926d | 41 | |
41888e7d | 42 | is($child->attr, "ibute", "getter inherited properly"); |
43 | ||
44 | $child->attr("ition"); | |
45 | is($child->attr, "ition", "setter inherited properly"); |