X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F020_attributes%2F011_more_attr_delegation.t;fp=t-failing%2F020_attributes%2F011_more_attr_delegation.t;h=75d6fa1cf8568b2fd2c4018d88e840315e04d2e8;hb=9864f0e4ba233c5f30ad6dc7c484ced43d883d27;hp=c588848e252509690b12ada884fba6c90a92c671;hpb=8845df4dd6432e3164d078ade741409061adae9f;p=gitmo%2FMouse.git diff --git a/t-failing/020_attributes/011_more_attr_delegation.t b/t/020_attributes/011_more_attr_delegation.t similarity index 78% rename from t-failing/020_attributes/011_more_attr_delegation.t rename to t/020_attributes/011_more_attr_delegation.t index c588848..75d6fa1 100644 --- a/t-failing/020_attributes/011_more_attr_delegation.t +++ b/t/020_attributes/011_more_attr_delegation.t @@ -1,13 +1,9 @@ #!/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; -$TODO = q{Mouse is not yet completed}; +use Test::More tests => 39; use Test::Exception; =pod @@ -80,24 +76,9 @@ do not fail at compile time. sub child_g_method_1 { "g1" } - package ChildH; - use Mouse; - - sub child_h_method_1 { "h1" } - sub parent_method_1 { "child_parent_1" } - - package ChildI; - use Mouse; - - sub child_i_method_1 { "i1" } - sub parent_method_1 { "child_parent_1" } - package Parent; use Mouse; - sub parent_method_1 { "parent_1" } - ::can_ok('Parent', 'parent_method_1'); - ::dies_ok { has child_a => ( is => "ro", @@ -186,30 +167,6 @@ do not fail at compile time. ); } "can delegate to object even without explicit reader"; - ::can_ok('Parent', 'parent_method_1'); - ::dies_ok { - has child_h => ( - isa => "ChildH", - is => "ro", - default => sub { ChildH->new }, - handles => sub { map { $_, $_ } $_[1]->get_all_method_names }, - ); - } "Can't override exisiting class method in delegate"; - ::can_ok('Parent', 'parent_method_1'); - - ::lives_ok { - has child_i => ( - isa => "ChildI", - is => "ro", - default => sub { ChildI->new }, - handles => sub { - map { $_, $_ } grep { !/^parent_method_1|meta$/ } - $_[1]->get_all_method_names; - }, - ); - } "Test handles code ref for skipping predefined methods"; - - sub parent_method { "p" } } @@ -222,10 +179,8 @@ isa_ok( $p->child_c, "ChildC" ); isa_ok( $p->child_d, "ChildD" ); isa_ok( $p->child_e, "ChildE" ); isa_ok( $p->child_f, "ChildF" ); -isa_ok( $p->child_i, "ChildI" ); ok(!$p->can('child_g'), '... no child_g accessor defined'); -ok(!$p->can('child_h'), '... no child_h accessor defined'); is( $p->parent_method, "p", "parent method" ); @@ -260,8 +215,3 @@ is( $p->child_e_method_2, "e2", "delegate to non moose class (child_e_method_2)" can_ok( $p, "child_g_method_1" ); is( $p->child_g_method_1, "g1", "delegate to moose class without reader (child_g_method_1)" ); - -can_ok( $p, "child_i_method_1" ); -is( $p->parent_method_1, "parent_1", "delegate doesn't override existing method" ); - -done_testing;