if (@conflicts) {
my $conflict = $conflicts[0];
+ my $roles = Moose::Util::english_list( map { q{'} . $_ . q{'} } @{ $conflict->roles } );
$error
- .= q{'}
- . $role->name
- . "' requires the method '"
+ .= "Due to a method name conflict in roles "
+ . $roles
+ . ", the method '"
. $conflict->name
- . "' to be implemented by '"
+ . "' must be implemented by '"
. $class->name
- . "' due to a method conflict"
+ . q{'};
}
elsif (@missing) {
my $noun = @missing == 1 ? 'method' : 'methods';
::throws_ok {
with 'Role::Bling', 'Role::Bling::Bling';
- } qr/requires the method \'bling\' to be implemented/, '... role methods conflicted 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 by 'My::Test3'/, '... role methods conflicted and method was required';
package My::Test4;
use Moose;
::throws_ok {
with 'Role::A::Conflict';
- } qr/requires.*'bar'/, '... 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 by 'Class::A::Conflict'/, '... did not fufill the requirement of &bar method';
package Class::A::Resolved;
use Moose;
::throws_ok {
with qw(Role::I);
- } qr/requires.*'foo'/, "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 by 'Class::C'/, "defining class Class::C fails";
sub zot { 'Class::C::zot' }
with 'Foo::Role',
'Bar::Role' => { excludes => 'foo' },
'Baz::Role';
- } qr/\'Foo::Role\|Bar::Role\|Baz::Role\' requires the method \'foo\' to 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 by 'My::Foo::Class::Broken'/,
'... composed our roles correctly';
}
with 'Foo::Role' => { alias => { 'foo' => 'foo_foo' }, excludes => 'foo' },
'Bar::Role' => { alias => { 'foo' => 'foo_foo' }, excludes => 'foo' },
'Baz::Role';
- } qr/\'Foo::Role\|Bar::Role\|Baz::Role\' requires the method \'foo_foo\' to 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 by 'My::Foo::Class::Broken'/,
'... composed our roles correctly';
}