use Scalar::Util 'blessed', 'reftype';
-use Test::More tests => 35;
+use Test::More tests => 36;
-BEGIN {
- use_ok('Class::MOP');
-}
+use Class::MOP;
=pod
Foo->meta->add_attribute('gorch' =>
reader => { 'get_gorch', => sub { (shift)->{gorch} } }
);
+
+ package Bar;
+ use metaclass;
+ Bar->meta->superclasses('Foo');
+
+ Bar->meta->add_attribute('quux' =>
+ accessor => 'quux',
+ );
}
can_ok('Foo', 'get_bar');
my $writer = $gorch_attr->get_write_method_ref;
isa_ok($reader, 'Class::MOP::Method');
- ok(!blessed($writer), '... it is not a plain old sub');
+ ok(blessed($writer), '... it is not a plain old sub');
+ isa_ok($writer, 'Class::MOP::Method');
is($reader->fully_qualified_name, 'Foo::get_gorch', '... it is the sub we are looking for');
+ is($writer->fully_qualified_name, 'Foo::__ANON__', '... it is the sub we are looking for');
}