From: Shawn M Moore Date: Tue, 2 Jun 2009 04:06:26 +0000 (-0400) Subject: Excluding a conflicting method is a certainly valid resolution (Ovid++) X-Git-Tag: 0.80~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=353d4b3b3ee3b009faf6125c6a1b48abc966739f;p=gitmo%2FMoose.git Excluding a conflicting method is a certainly valid resolution (Ovid++) --- diff --git a/lib/Moose/Meta/Role/Application/ToClass.pm b/lib/Moose/Meta/Role/Application/ToClass.pm index 6b25811..7409a6f 100644 --- a/lib/Moose/Meta/Role/Application/ToClass.pm +++ b/lib/Moose/Meta/Role/Application/ToClass.pm @@ -84,7 +84,7 @@ sub check_required_methods { . $roles . ", the method '" . $conflict->name - . "' must be implemented by '" + . "' must be implemented or excluded by '" . $class->name . q{'}; } diff --git a/t/030_roles/005_role_conflict_detection.t b/t/030_roles/005_role_conflict_detection.t index 7c1f845..7da76ad 100644 --- a/t/030_roles/005_role_conflict_detection.t +++ b/t/030_roles/005_role_conflict_detection.t @@ -100,7 +100,7 @@ Role method conflicts ::throws_ok { with 'Role::Bling', 'Role::Bling::Bling'; - } qr/Due to a method name conflict in roles 'Role::Bling' and 'Role::Bling::Bling', the method 'bling' must be implemented by 'My::Test3'/, '... role methods conflict and method was required'; + } qr/Due to a method name conflict in roles 'Role::Bling' and 'Role::Bling::Bling', the method 'bling' must be implemented or excluded by 'My::Test3'/, '... role methods conflict and method was required'; package My::Test4; use Moose; @@ -363,7 +363,7 @@ is(Role::Reality->meta->get_method('twist')->(), ::throws_ok { with qw(Role1 Role2); - } qr/Due to a method name conflict in roles 'Role1' and 'Role2', the method 'foo' must be implemented by 'Conflicts'/; + } qr/Due to a method name conflict in roles 'Role1' and 'Role2', the method 'foo' must be implemented or excluded by 'Conflicts'/; } =pod diff --git a/t/030_roles/011_overriding.t b/t/030_roles/011_overriding.t index 49b8237..32bd113 100644 --- a/t/030_roles/011_overriding.t +++ b/t/030_roles/011_overriding.t @@ -64,7 +64,7 @@ is( Class::A->new->xxy, "Role::B::xxy", "... got the right xxy method" ); ::throws_ok { with 'Role::A::Conflict'; - } qr/Due to a method name conflict in roles 'Role::A' and 'Role::A::Conflict', the method 'bar' must be implemented by 'Class::A::Conflict'/, '... did not fufill the requirement of &bar method'; + } qr/Due to a method name conflict in roles 'Role::A' and 'Role::A::Conflict', the method 'bar' must be implemented or excluded by 'Class::A::Conflict'/, '... did not fufill the requirement of &bar method'; package Class::A::Resolved; use Moose; @@ -181,7 +181,7 @@ ok(Role::D::And::E::Conflict->meta->requires_method('bar'), '... Role::D::And::E ::throws_ok { with qw(Role::I); - } qr/Due to a method name conflict in roles 'Role::H' and 'Role::J', the method 'foo' must be implemented by 'Class::C'/, "defining class Class::C fails"; + } qr/Due to a method name conflict in roles 'Role::H' and 'Role::J', the method 'foo' must be implemented or excluded by 'Class::C'/, "defining class Class::C fails"; sub zot { 'Class::C::zot' } diff --git a/t/030_roles/012_method_exclusion_in_composition.t b/t/030_roles/012_method_exclusion_in_composition.t index 93557f4..b0ae2df 100644 --- a/t/030_roles/012_method_exclusion_in_composition.t +++ b/t/030_roles/012_method_exclusion_in_composition.t @@ -72,7 +72,7 @@ ok(My::OtherRole->meta->requires_method('bar'), '... and the &bar method is requ with 'Foo::Role', 'Bar::Role' => { excludes => 'foo' }, 'Baz::Role'; - } qr/Due to a method name conflict in roles 'Baz::Role' and 'Foo::Role', the method 'foo' must be implemented by 'My::Foo::Class::Broken'/, + } qr/Due to a method name conflict in roles 'Baz::Role' and 'Foo::Role', the method 'foo' must be implemented or excluded by 'My::Foo::Class::Broken'/, '... composed our roles correctly'; } diff --git a/t/030_roles/013_method_aliasing_in_composition.t b/t/030_roles/013_method_aliasing_in_composition.t index f29a4be..787b2bb 100644 --- a/t/030_roles/013_method_aliasing_in_composition.t +++ b/t/030_roles/013_method_aliasing_in_composition.t @@ -105,7 +105,7 @@ ok(My::AliasingRole->meta->requires_method('bar'), '... and the &bar method is r with 'Foo::Role' => { alias => { 'foo' => 'foo_foo' }, excludes => 'foo' }, 'Bar::Role' => { alias => { 'foo' => 'foo_foo' }, excludes => 'foo' }, 'Baz::Role'; - } qr/Due to a method name conflict in roles 'Bar::Role' and 'Foo::Role', the method 'foo_foo' must be implemented by 'My::Foo::Class::Broken'/, + } qr/Due to a method name conflict in roles 'Bar::Role' and 'Foo::Role', the method 'foo_foo' must be implemented or excluded by 'My::Foo::Class::Broken'/, '... composed our roles correctly'; }