X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F030_roles%2Ffailing%2F012_method_exclusion_in_composition.t;h=d852b17e12e22d1c35567d2324cea13b11647714;hb=6cfa1e5e70616fb102915489c02d8347ffa912fb;hp=56d851661e3c3fcf859550e541f5064f1ade40e2;hpb=6719984210754e8d012ae678536f194c35000823;p=gitmo%2FMouse.git diff --git a/t/030_roles/failing/012_method_exclusion_in_composition.t b/t/030_roles/failing/012_method_exclusion_in_composition.t index 56d8516..d852b17 100644 --- a/t/030_roles/failing/012_method_exclusion_in_composition.t +++ b/t/030_roles/failing/012_method_exclusion_in_composition.t @@ -19,7 +19,7 @@ use Test::Exception; package My::Class; use Mouse; - with 'My::Role' => { excludes => 'bar' }; + with 'My::Role' => { -excludes => 'bar' }; } ok(My::Class->meta->has_method($_), "we have a $_ method") for qw(foo baz); @@ -29,7 +29,7 @@ ok(!My::Class->meta->has_method('bar'), '... but we excluded bar'); package My::OtherRole; use Mouse::Role; - with 'My::Role' => { excludes => 'foo' }; + with 'My::Role' => { -excludes => 'foo' }; sub foo { 'My::OtherRole::foo' } sub bar { 'My::OtherRole::bar' } @@ -43,37 +43,37 @@ ok(My::OtherRole->meta->requires_method('bar'), '... and the &bar method is requ { package Foo::Role; use Mouse::Role; - + sub foo { 'Foo::Role::foo' } - + package Bar::Role; use Mouse::Role; - - sub foo { 'Bar::Role::foo' } + + sub foo { 'Bar::Role::foo' } package Baz::Role; use Mouse::Role; - - sub foo { 'Baz::Role::foo' } - + + sub foo { 'Baz::Role::foo' } + package My::Foo::Class; use Mouse; - + ::lives_ok { - with 'Foo::Role' => { excludes => 'foo' }, - 'Bar::Role' => { excludes => 'foo' }, + with 'Foo::Role' => { -excludes => 'foo' }, + 'Bar::Role' => { -excludes => 'foo' }, 'Baz::Role'; } '... composed our roles correctly'; - + package My::Foo::Class::Broken; use Mouse; - + ::throws_ok { with 'Foo::Role', - 'Bar::Role' => { excludes => 'foo' }, + '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\'/, - '... composed our roles correctly'; + } 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'; } { @@ -88,8 +88,8 @@ ok(My::OtherRole->meta->requires_method('bar'), '... and the &bar method is requ use Mouse::Role; ::lives_ok { - with 'Foo::Role' => { excludes => 'foo' }, - 'Bar::Role' => { excludes => 'foo' }, + with 'Foo::Role' => { -excludes => 'foo' }, + 'Bar::Role' => { -excludes => 'foo' }, 'Baz::Role'; } '... composed our roles correctly'; } @@ -103,7 +103,7 @@ ok(!My::Foo::Role->meta->requires_method('foo'), '... and the &foo method is not ::lives_ok { with 'Foo::Role', - 'Bar::Role' => { excludes => 'foo' }, + 'Bar::Role' => { -excludes => 'foo' }, 'Baz::Role'; } '... composed our roles correctly'; }