1use strict; 2use warnings; 3 4{ 5 package TestClass; 6 7 use Moose; 8 use MooseX::MarkAsMethods autoclean => 1; 9 10 use overload q{""} => sub { shift->stringify }, fallback => 1; 11 12 has class_att => (isa => 'Str', is => 'rw'); 13 sub stringify { 'from class' } 14} 15{ 16 package TestClass::Baby; 17 18 use Moose; 19 use MooseX::MarkAsMethods autoclean => 1; 20 21 extends 'TestClass'; 22 23 #use overload q{""} => sub { shift->stringify }, fallback => 1; 24 25 has baby_class_att => (isa => 'Str', is => 'rw'); 26 #sub stringify { 'from class' } 27} 28 29use Test::More 0.92; 30use Test::Moose; 31 32require 't/funcs.pm' unless eval { require funcs }; 33 34check_sugar_removed_ok('TestClass'); 35check_sugar_removed_ok('TestClass::Baby'); 36 37my $T = make_and_check('TestClass'); 38 39my $t = make_and_check( 40 'TestClass::Baby', 41 undef, 42 [ qw{ class_att baby_class_att } ], 43); 44 45check_overloads($T, '""', 'from class'); 46check_overloads($t, '""', 'from class'); 47 48done_testing; 49 50