Skip to content

Commit

Permalink
Add test for conflict detection working
Browse files Browse the repository at this point in the history
  • Loading branch information
bobtfish committed Sep 20, 2009
1 parent fa4a1fd commit b390526
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions t/role_method_conflict_detection.t
@@ -0,0 +1,41 @@
use strict;
use warnings;
{
package RoleOne;
use MooseX::MethodAttributes::Role;

sub foo {}
}
{
package RoleTwo;
use MooseX::MethodAttributes::Role;

sub foo {}
}
{
package RoleThree;
use MooseX::MethodAttributes::Role;

sub foo : Action {}
}
{
package RoleFour;
use MooseX::MethodAttributes::Role;

sub foo : ActionRole {}
}
{
package MyClass;
use Moose;
use Test::More tests => 3;
use Test::Exception;

throws_ok { with qw/RoleOne RoleTwo/; } qr/method name conflict/,
'Normal methods conflict detected';

throws_ok { with qw/RoleThree RoleFour/; } qr/method name conflict/,
'Attributed methods conflict detected';

throws_ok { with qw/RoleOne RoleFour/; } qr/method name conflict/,
'Attributed and non attributed methods combination - conflict detected';
}

0 comments on commit b390526

Please sign in to comment.