3 use Test::More tests => 36;
5 for my $class (qw(Class::Accessor Class::Accessor::Fast Class::Accessor::Faster)) {
7 my $silly = "Silly::$class";
10 @{"${silly}::ISA"} = ($class);
11 $silly->follow_best_practice;
12 $silly->mk_accessors(qw( foo ));
13 $silly->mk_ro_accessors(qw(roro));
14 $silly->mk_wo_accessors(qw(wowo));
17 for my $f (qw/foo roro /) {
18 ok $silly->can("get_$f"), "'get_$f' method exists";
21 for my $f (qw/foo wowo/) {
22 ok $silly->can("set_$f"), "'set_$f' method exists";
25 for my $f (qw/foo roro wowo set_roro get_wowo/) {
26 ok !$silly->can($f), "no '$f' method";
29 my $test = $silly->new({
35 is($test->get_foo, "bar", "initial foo");
36 $test->set_foo("stuff");
37 is($test->get_foo, "stuff", "new foo");