Commit | Line | Data |
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!!! |
4 | use t::lib::MooseCompat; |
41888e7d |
5 | |
6 | use strict; |
7 | use warnings; |
8 | |
6217087a |
9 | use Test::More; |
41888e7d |
10 | use 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 |
32 | is(Child->meta->name, 'Child', "correct metaclass name"); |
6217087a |
33 | |
41888e7d |
34 | my $child = Child->new(attr => "ibute"); |
35 | ok($child, "constructor works"); |
36 | |
37 | is($child->attr, "ibute", "getter inherited properly"); |
38 | |
39 | $child->attr("ition"); |
40 | is($child->attr, "ition", "setter inherited properly"); |
6217087a |
41 | |
42 | done_testing; |