my $HasMXAH;
BEGIN
{
- if ( eval 'use MooseX::AttributeHelpers 0.12; 1;' )
+ if ( eval 'use MooseX::AttributeHelpers 0.13; 1;' )
{
$HasMXAH = 1;
}
}
-plan tests => 25;
-
{
package HasClassAttribute;
( is => 'rw',
isa => 'Delegatee',
handles => [ 'units', 'color' ],
+ # if it's not lazy it makes a new object before we define
+ # Delegatee's attributes.
+ lazy => 1,
default => sub { Delegatee->new() },
);
);
no Moose;
- no MooseX::ClassAttribute;
sub BUILD
{
my $class = shift;
$class->meta()->make_immutable();
- MooseX::ClassAttribute::container_class()->meta()->make_immutable();
Delegatee->meta()->make_immutable();
}
}
( is => 'ro',
default => 'blue',
);
+
+ no Moose;
}
{
class_has '+ReadOnlyAttribute' =>
( default => 30 );
+
+ no Moose;
}
sub run_tests
{
+ plan tests => 24;
+
local $Test::Builder::Level = $Test::Builder::Level + 1;
{
'units() delegates to Delegatee and returns 5' );
}
- {
- ok( ! HasClassAttribute->can('class_has'),
- q{'no MooseX::ClassAttribute' remove class_has from HasClassAttribute} );
- }
-
SKIP:
{
skip 'These tests require MooseX::AttributeHelpers', 4