Update changes with credit for latest bug fix
[gitmo/Moose.git] / t / 050_metaclasses / 017_traits_plain_subclass.t
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 SKIP:
10 {
11     skip 'This blows up because Moose thinks the metaclasses are incompatible', 4;
12
13 {
14     package NoOpTrait;
15     use Moose::Role;
16 }
17
18 {
19     package Parent;
20     use Moose -traits => 'NoOpTrait';
21
22     has attr => (
23         is  => 'rw',
24         isa => 'Str',
25     );
26 }
27
28 {
29     package Child;
30     use base 'Parent';
31 }
32
33 is(Child->meta->name, 'Child', "correct metaclass name");
34
35 my $child = Child->new(attr => "ibute");
36 ok($child, "constructor works");
37
38 is($child->attr, "ibute", "getter inherited properly");
39
40 $child->attr("ition");
41 is($child->attr, "ition", "setter inherited properly");
42
43 }
44