4 use Test::More tests => 4;
5 use Mouse::Util ':test';
11 # We want this attr to have a reader and writer with unconventional names,
12 # and not the default rw_attr method. -- rjbs, 2008-12-04
14 reader => 'read_attr',
15 writer => 'write_attr',
19 my $object = Class->new;
21 ok(!$object->can('rw_attr'), "no rw_attr method because wasn't 'is' ro or rw");
22 ok($object->can('read_attr'), "did get a reader");
23 ok($object->can('write_attr'), "did get a writer");
25 $object->write_attr(2);
27 is($object->read_attr, 2, "writing to the object worked");