X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F030_roles%2F012_method_exclusion_in_composition.t;h=64c36050cd08674d46d23d5d2f113d63273ff3d9;hb=b10dde3a27c11623547417c599ccbd4f92e42651;hp=fa74523763a975c1a9e64a53956af9ccc980913b;hpb=d4e538d9bf46d1c14d2ecfd36ac35ed541ae7ee6;p=gitmo%2FMoose.git diff --git a/t/030_roles/012_method_exclusion_in_composition.t b/t/030_roles/012_method_exclusion_in_composition.t index fa74523..64c3605 100644 --- a/t/030_roles/012_method_exclusion_in_composition.t +++ b/t/030_roles/012_method_exclusion_in_composition.t @@ -4,7 +4,7 @@ use strict; use warnings; use Test::More; -use Test::Exception; +use Test::Fatal; { @@ -58,21 +58,20 @@ ok(My::OtherRole->meta->requires_method('bar'), '... and the &bar method is requ package My::Foo::Class; use Moose; - ::lives_ok { + ::is( ::exception { with 'Foo::Role' => { -excludes => 'foo' }, 'Bar::Role' => { -excludes => 'foo' }, 'Baz::Role'; - } '... composed our roles correctly'; + }, undef, '... composed our roles correctly' ); package My::Foo::Class::Broken; use Moose; - ::throws_ok { + ::like( ::exception { 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 or excluded 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' ); } { @@ -86,11 +85,11 @@ ok(My::OtherRole->meta->requires_method('bar'), '... and the &bar method is requ package My::Foo::Role; use Moose::Role; - ::lives_ok { + ::is( ::exception { with 'Foo::Role' => { -excludes => 'foo' }, 'Bar::Role' => { -excludes => 'foo' }, 'Baz::Role'; - } '... composed our roles correctly'; + }, undef, '... composed our roles correctly' ); } ok(My::Foo::Role->meta->has_method('foo'), "we have a foo method"); @@ -100,11 +99,11 @@ ok(!My::Foo::Role->meta->requires_method('foo'), '... and the &foo method is not package My::Foo::Role::Other; use Moose::Role; - ::lives_ok { + ::is( ::exception { with 'Foo::Role', 'Bar::Role' => { -excludes => 'foo' }, 'Baz::Role'; - } '... composed our roles correctly'; + }, undef, '... composed our roles correctly' ); } ok(!My::Foo::Role::Other->meta->has_method('foo'), "we dont have a foo method");