Mouse::Util::does_role() respects $thing->does() method
[gitmo/Mouse.git] / t / 050_metaclasses / 017_use_base_of_moose.t
CommitLineData
41888e7d 1#!/usr/bin/env perl
6217087a 2# This is automatically generated by author/import-moose-test.pl.
3# DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4use t::lib::MooseCompat;
41888e7d 5
6use strict;
7use warnings;
8
6217087a 9use Test::More;
41888e7d 10use Test::Exception;
11
12{
13 package NoOpTrait;
14 use Mouse::Role;
15}
16
17{
18 package Parent;
6217087a 19 use Mouse -traits => 'NoOpTrait';
41888e7d 20
21 has attr => (
22 is => 'rw',
23 isa => 'Str',
24 );
25}
26
27{
28 package Child;
29 use base 'Parent';
30}
6217087a 31
41888e7d 32is(Child->meta->name, 'Child', "correct metaclass name");
6217087a 33
41888e7d 34my $child = Child->new(attr => "ibute");
35ok($child, "constructor works");
36
37is($child->attr, "ibute", "getter inherited properly");
38
39$child->attr("ition");
40is($child->attr, "ition", "setter inherited properly");
6217087a 41
42done_testing;