trAvis - MANAGER
Edit File: 017_use_base_of_moose.t
#!/usr/bin/perl # This is automatically generated by author/import-moose-test.pl. # DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!! use t::lib::MooseCompat; use strict; use warnings; use Test::More; use Test::Exception; { package NoOpTrait; use Mouse::Role; } { package Parent; use Mouse -traits => 'NoOpTrait'; has attr => ( is => 'rw', isa => 'Str', ); } { package Child; use base 'Parent'; } is(Child->meta->name, 'Child', "correct metaclass name"); my $child = Child->new(attr => "ibute"); ok($child, "constructor works"); is($child->attr, "ibute", "getter inherited properly"); $child->attr("ition"); is($child->attr, "ition", "setter inherited properly"); done_testing;