From: Shawn M Moore Date: Wed, 26 Nov 2008 02:47:08 +0000 (+0000) Subject: Finish excludes tests X-Git-Tag: 0.05~67 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=636c0aa545ecbeafdb7a0efe97cf9f37df6ade2b;p=gitmo%2FMooseX-Role-Parameterized.git Finish excludes tests --- diff --git a/t/007-excludes.t b/t/007-excludes.t index b312bed..f7673d8 100644 --- a/t/007-excludes.t +++ b/t/007-excludes.t @@ -1,7 +1,7 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 1; +use Test::More tests => 3; use Test::Exception; do { @@ -28,49 +28,21 @@ sub excludes_roles { } @_ } -TODO: { - local $TODO = "the error message says Role::A excludes Role::A..??!"; - throws_ok { - Moose::Meta::Class->create_anon_class( - roles => [ 'Role::A', excludes_roles('Role::A') ], - ); - } qr/^Conflict detected: Moose::Meta::Role::__ANON__::SERIAL::\d+ excludes role 'Role::A'/; +lives_ok { + Moose::Meta::Class->create_anon_class( + roles => [ excludes_roles('Role::A') ], + ); +}; + +throws_ok { + Moose::Meta::Class->create_anon_class( + roles => [ 'Role::A', excludes_roles('Role::A') ], + ); +} qr/^Conflict detected: Role Moose::Meta::Role::__ANON__::SERIAL::\d+ excludes role 'Role::A'/; + +lives_ok { + Moose::Meta::Class->create_anon_class( + roles => [ 'Role::B', excludes_roles('Role::A') ], + ); }; -#lives_ok { -# Moose::Meta::Class->create_anon_class( -# methods => { -# alpha => sub {}, -# }, -# roles => [ requires_names('alpha') ], -# ); -#}; -# -#throws_ok { -# Moose::Meta::Class->create_anon_class( -# methods => { -# alpha => sub {}, -# }, -# roles => [ requires_names('alpha', 'beta') ], -# ); -#} qr/'Moose::Meta::Role::__ANON__::SERIAL::\d+\|Moose::Meta::Role::__ANON__::SERIAL::\d+' requires the method 'beta' to be implemented by 'Class::MOP::Class::__ANON__::SERIAL::\d+'/; -# -#throws_ok { -# Moose::Meta::Class->create_anon_class( -# methods => { -# beta => sub {}, -# }, -# roles => [ requires_names('alpha', 'beta') ], -# ); -#} qr/'Moose::Meta::Role::__ANON__::SERIAL::\d+\|Moose::Meta::Role::__ANON__::SERIAL::\d+' requires the method 'alpha' to be implemented by 'Class::MOP::Class::__ANON__::SERIAL::\d+'/; -# -#lives_ok { -# Moose::Meta::Class->create_anon_class( -# methods => { -# alpha => sub {}, -# beta => sub {}, -# }, -# roles => [ requires_names('alpha', 'beta') ], -# ); -#}; -#