6 use Test::More tests => 16;
14 package My::Meta::Class;
19 extends 'Moose::Meta::Class';
22 my $anon = My::Meta::Class->create_anon_class();
23 isa_ok($anon, 'My::Meta::Class');
24 isa_ok($anon, 'Moose::Meta::Class');
25 isa_ok($anon, 'Class::MOP::Class');
28 package My::Meta::Attribute::DefaultReadOnly;
33 extends 'Moose::Meta::Attribute';
39 $next->($self, $name, (is => 'ro'), @_);
44 my $attr = My::Meta::Attribute::DefaultReadOnly->new('foo');
45 isa_ok($attr, 'My::Meta::Attribute::DefaultReadOnly');
46 isa_ok($attr, 'Moose::Meta::Attribute');
47 isa_ok($attr, 'Class::MOP::Attribute');
49 ok($attr->has_reader, '... the attribute has a reader (as expected)');
50 ok(!$attr->has_writer, '... the attribute does not have a writer (as expected)');
51 ok(!$attr->has_accessor, '... the attribute does not have an accessor (as expected)');
55 my $attr = My::Meta::Attribute::DefaultReadOnly->new('foo', (is => 'rw'));
56 isa_ok($attr, 'My::Meta::Attribute::DefaultReadOnly');
57 isa_ok($attr, 'Moose::Meta::Attribute');
58 isa_ok($attr, 'Class::MOP::Attribute');
60 ok(!$attr->has_reader, '... the attribute does not have a reader (as expected)');
61 ok(!$attr->has_writer, '... the attribute does not have a writer (as expected)');
62 ok($attr->has_accessor, '... the attribute does have an accessor (as expected)');