4 use Test::More tests => 9;
12 default => sub { 10 },
17 default => sub { 20 },
25 my $object = Class->new;
26 is($object->x, 10, "attribute has a default of 10");
27 is($object->y, 20, "attribute has a default of 20");
28 is($object->z, undef, "attribute has no default");
30 is($object->x(5), 5, "setting a new value");
31 is($object->y(25), 25, "setting a new value");
32 is($object->z(125), 125, "setting a new value");
34 is($object->x, 5, "setting a new value does not trigger default");
35 is($object->y, 25, "setting a new value does not trigger default");
36 is($object->z, 125, "setting a new value does not trigger default");