From: Dave Rolsky Date: Thu, 4 Dec 2008 16:15:40 +0000 (+0000) Subject: Got rid of a bunch of random whitespace and tidied the file X-Git-Tag: 0.62_02~21 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4c035b8208b5286b81e4ee3be730b10c56df92d2;p=gitmo%2FMoose.git Got rid of a bunch of random whitespace and tidied the file --- diff --git a/t/030_roles/004_role_composition_errors.t b/t/030_roles/004_role_composition_errors.t index 0325dc4..d47eab3 100644 --- a/t/030_roles/004_role_composition_errors.t +++ b/t/030_roles/004_role_composition_errors.t @@ -9,80 +9,96 @@ use Test::Exception; { + package Foo::Role; use Moose::Role; - + requires 'foo'; } is_deeply( [ sort Foo::Role->meta->get_required_method_list ], - [ 'foo' ], - '... the Foo::Role has a required method (foo)'); + ['foo'], + '... the Foo::Role has a required method (foo)' +); # classes which does not implement required method { + package Foo::Class; use Moose; - - ::dies_ok { with('Foo::Role') } '... no foo method implemented by Foo::Class'; + + ::dies_ok{ with('Foo::Role') } + '... no foo method implemented by Foo::Class'; } # class which does implement required method { + package Bar::Class; use Moose; - - ::dies_ok { with('Foo::Class') } '... cannot consume a class, it must be a role'; - ::lives_ok { with('Foo::Role') } '... has a foo method implemented by Bar::Class'; - - sub foo { 'Bar::Class::foo' } + + ::dies_ok{ with('Foo::Class') } + '... cannot consume a class, it must be a role'; + ::lives_ok{ with('Foo::Role') } + '... has a foo method implemented by Bar::Class'; + + sub foo {'Bar::Class::foo'} } # role which does implement required method { + package Bar::Role; use Moose::Role; - - ::lives_ok { with('Foo::Role') } '... has a foo method implemented by Bar::Role'; - - sub foo { 'Bar::Role::foo' } + + ::lives_ok{ with('Foo::Role') } + '... has a foo method implemented by Bar::Role'; + + sub foo {'Bar::Role::foo'} } is_deeply( [ sort Bar::Role->meta->get_required_method_list ], [], - '... the Bar::Role has not inherited the required method from Foo::Role'); + '... the Bar::Role has not inherited the required method from Foo::Role' +); # role which does not implement required method { + package Baz::Role; use Moose::Role; - - ::lives_ok { with('Foo::Role') } '... no foo method implemented by Baz::Role'; + + ::lives_ok{ with('Foo::Role') } + '... no foo method implemented by Baz::Role'; } is_deeply( [ sort Baz::Role->meta->get_required_method_list ], - [ 'foo' ], - '... the Baz::Role has inherited the required method from Foo::Role'); - + ['foo'], + '... the Baz::Role has inherited the required method from Foo::Role' +); + # classes which does not implement required method { + package Baz::Class; use Moose; - ::dies_ok { with('Baz::Role') } '... no foo method implemented by Baz::Class2'; + ::dies_ok{ with('Baz::Role') } + '... no foo method implemented by Baz::Class2'; } # class which does implement required method { + package Baz::Class2; use Moose; - ::lives_ok { with('Baz::Role') } '... has a foo method implemented by Baz::Class2'; + ::lives_ok{ with('Baz::Role') } + '... has a foo method implemented by Baz::Class2'; - sub foo { 'Baz::Class2::foo' } -} - + sub foo {'Baz::Class2::foo'} +}