changelog for Moose-2.0801
[gitmo/Moose.git] / t / metaclasses / use_base_of_moose.t
CommitLineData
2b72f3b4 1#!/usr/bin/env perl
2
3use strict;
4use warnings;
5
a28e50e4 6use 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
28is(Child->meta->name, 'Child', "correct metaclass name");
29
30my $child = Child->new(attr => "ibute");
31ok($child, "constructor works");
32
33is($child->attr, "ibute", "getter inherited properly");
34
35$child->attr("ition");
36is($child->attr, "ition", "setter inherited properly");
a28e50e4 37
38done_testing;