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