use strict;
use warnings;
-use Test::More tests => 25;
+use Test::More;
use File::Spec;
-BEGIN {use Class::MOP;
+use Class::MOP;
+
+BEGIN {
require_ok(File::Spec->catfile('examples', 'LazyClass.pod'));
}
{
package BinaryTree;
-
+
use metaclass (
'attribute_metaclass' => 'LazyClass::Attribute',
- 'instance_metaclass' => 'LazyClass::Instance',
+ 'instance_metaclass' => 'LazyClass::Instance',
);
BinaryTree->meta->add_attribute('node' => (
accessor => 'node',
init_arg => 'node'
));
-
+
BinaryTree->meta->add_attribute('left' => (
reader => 'left',
default => sub { BinaryTree->new() }
));
-
+
BinaryTree->meta->add_attribute('right' => (
reader => 'right',
- default => sub { BinaryTree->new() }
- ));
+ default => sub { BinaryTree->new() }
+ ));
sub new {
my $class = shift;
ok(!exists($root->right->{'left'}), '... left attribute still has not been initialized yet');
ok(!exists($root->right->{'right'}), '... right attribute still has not been initialized yet');
+done_testing;