use strict;
use warnings;
-use Test::More tests => 9;
+use Test::More tests => 7;
use Test::Exception;
do {
my $p = shift;
has $p->attribute => (
- is => 'Int',
+ is => 'rw',
);
};
};
MyCompositeRoleB => { accessor => 'bar' };
};
-lives_ok {
- ok(MyDoubleConsumer->can('foo'), 'first role in composite applied successfully');
- ok(MyDoubleConsumer->can('bar'), 'second role in composite applied successfully');
-} 'testing composite roles lived';
+ok(MyDoubleConsumer->can('foo'), 'first role in composite applied successfully');
+ok(MyDoubleConsumer->can('bar'), 'second role in composite applied successfully');
do {
package MyExtendingRole;
do {
package MyExtendedConsumer;
use Moose;
- with MyCompositeRoleA => { attribute => 'bar' },
+ with MyCompositeRoleA => { attribute => 'baz' },
MyExtendingRole => { foo => 23 };
};
-lives_ok {
- ok(MyExtendedConsumer->can('bar'), 'role composed through other role applied successfully');
- is(MyExtendedConsumer->new->foo, 23, 'role composing other role applied successfully');
-} 'testing role through application through other role lived';
+ok(MyExtendedConsumer->can('baz'), 'role composed directly applied successfully');
+ok(MyExtendedConsumer->can('bar'), 'role composed through other role applied successfully');
+is(eval { MyExtendedConsumer->new->foo }, 23, 'role composing other role applied successfully');
do {
package MyRoleProxy;
);
};
-lives_ok {
- ok(MyProxyConsumer->can('baz'), 'proxied role got applied successfully');
- ok(MyProxyConsumer->can('qux'), 'other role besides proxied one got applied successfully');
-} 'testing proxied roles lived';
+ok(MyProxyConsumer->can('baz'), 'proxied role got applied successfully');
+ok(MyProxyConsumer->can('qux'), 'other role besides proxied one got applied successfully');