From: Stevan Little Date: Fri, 14 Jul 2006 01:52:11 +0000 (+0000) Subject: foo X-Git-Tag: 0_12~20^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3035034f6e5394b9b5de42c9ae460ac4da3a381d;p=gitmo%2FMoose.git foo --- diff --git a/t/047_role_conflict_edge_cases.t b/t/047_role_conflict_edge_cases.t index b681caf..fae06a7 100644 --- a/t/047_role_conflict_edge_cases.t +++ b/t/047_role_conflict_edge_cases.t @@ -53,117 +53,6 @@ is(My::Test::Class1->foo, 'Role::Base::foo', '... got the right value from metho =pod Check for repeated inheritence causing -a method conflict with method modifiers -(which is not really a conflict) - -=cut - -=begin nonesense - -{ - package Role::Base2; - use Moose::Role; - - override 'foo' => sub { super() . ' -> Role::Base::foo' }; - - package Role::Derived3; - use Moose::Role; - - with 'Role::Base2'; - - package Role::Derived4; - use Moose::Role; - - with 'Role::Base2'; - - package My::Test::Class2::Base; - use Moose; - - sub foo { 'My::Test::Class2::Base' } - - package My::Test::Class2; - use Moose; - - extends 'My::Test::Class2::Base'; - - ::lives_ok { - with 'Role::Derived3', 'Role::Derived4'; - } '... roles composed okay (no conflicts)'; -} - -ok(Role::Base2->meta->has_override_method_modifier('foo'), '... have the method foo as expected'); -ok(Role::Derived3->meta->has_override_method_modifier('foo'), '... have the method foo as expected'); -ok(Role::Derived4->meta->has_override_method_modifier('foo'), '... have the method foo as expected'); -ok(My::Test::Class2->meta->has_method('foo'), '... have the method foo as expected'); -isa_ok(My::Test::Class2->meta->get_method('foo'), 'Moose::Meta::Method::Overriden'); -ok(My::Test::Class2::Base->meta->has_method('foo'), '... have the method foo as expected'); -isa_ok(My::Test::Class2::Base->meta->get_method('foo'), 'Class::MOP::Method'); - -is(My::Test::Class2::Base->foo, 'My::Test::Class2::Base', '... got the right value from method'); -is(My::Test::Class2->foo, 'My::Test::Class2::Base -> Role::Base::foo', '... got the right value from method'); - -=cut - -=pod - -Check for repeated inheritence of the -same code. There are no conflicts with -before/around/after method modifiers. - -This tests around, but should work the -same for before/afters as well - -=cut - -=begin nonesense - -{ - package Role::Base3; - use Moose::Role; - - around 'foo' => sub { 'Role::Base::foo(' . (shift)->() . ')' }; - - package Role::Derived5; - use Moose::Role; - - with 'Role::Base3'; - - package Role::Derived6; - use Moose::Role; - - with 'Role::Base3'; - - package My::Test::Class3::Base; - use Moose; - - sub foo { 'My::Test::Class3::Base' } - - package My::Test::Class3; - use Moose; - - extends 'My::Test::Class3::Base'; - - ::lives_ok { - with 'Role::Derived5', 'Role::Derived6'; - } '... roles composed okay (no conflicts)'; -} - -ok(Role::Base3->meta->has_around_method_modifiers('foo'), '... have the method foo as expected'); -ok(Role::Derived5->meta->has_around_method_modifiers('foo'), '... have the method foo as expected'); -ok(Role::Derived6->meta->has_around_method_modifiers('foo'), '... have the method foo as expected'); -ok(My::Test::Class3->meta->has_method('foo'), '... have the method foo as expected'); -isa_ok(My::Test::Class3->meta->get_method('foo'), 'Class::MOP::Method::Wrapped'); -ok(My::Test::Class3::Base->meta->has_method('foo'), '... have the method foo as expected'); -isa_ok(My::Test::Class3::Base->meta->get_method('foo'), 'Class::MOP::Method'); - -is(My::Test::Class3::Base->foo, 'My::Test::Class3::Base', '... got the right value from method'); -is(My::Test::Class3->foo, 'Role::Base::foo(My::Test::Class3::Base)', '... got the right value from method'); - -=cut - -=pod - -Check for repeated inheritence causing a attr conflict (which is not really a conflict)