use strict;
use warnings;
-use Test::More tests => 1;
+use Test::More;
use Test::Exception;
-lives_ok {
- Bar->new->_connections;
-} 'finds a class attribute under role composition';
+{
+ package Role;
+ use Moose::Role;
+ use MooseX::ClassAttribute;
-BEGIN {
-
-package Role;
-use Moose::Role;
-use MooseX::ClassAttribute;
-
-class_has '_connections' => (
- is => 'ro',
- isa => 'HashRef',
- default => sub { {} },
- );
+ class_has 'CA' => (
+ is => 'ro',
+ isa => 'HashRef',
+ default => sub { {} },
+ );
+}
-package Role2;
-use Moose::Role;
+{
+ package Role2;
+ use Moose::Role;
+}
-package Bar;
-use Moose;
+{
+ package Bar;
+ use Moose;
-with ('Role2','Role');
+ with( 'Role2', 'Role' );
+}
+{
+ local $TODO = 'Class attributes are lost during role composition';
+ can_ok( 'Bar', 'CA', );
}
+
+done_testing();