Commit | Line | Data |
2b72f3b4 |
1 | #!/usr/bin/env perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
6 | use Test::More tests => 4; |
7 | use Test::Exception; |
8 | |
9 | { |
10 | package NoOpTrait; |
11 | use Moose::Role; |
12 | } |
13 | |
14 | { |
15 | package Parent; |
16 | use Moose -traits => 'NoOpTrait'; |
17 | |
18 | has attr => ( |
19 | is => 'rw', |
20 | isa => 'Str', |
21 | ); |
22 | } |
23 | |
24 | { |
25 | package Child; |
26 | use base 'Parent'; |
27 | } |
28 | |
29 | is(Child->meta->name, 'Child', "correct metaclass name"); |
30 | |
31 | my $child = Child->new(attr => "ibute"); |
32 | ok($child, "constructor works"); |
33 | |
34 | is($child->attr, "ibute", "getter inherited properly"); |
35 | |
36 | $child->attr("ition"); |
37 | is($child->attr, "ition", "setter inherited properly"); |