4 use Test::More tests => 7;
10 use MooseX::HasDefaults::RW;
21 has favorite_language => (
27 can_ok(Person => qw(name birth_year favorite_language));
29 my $whacko = Person->new(name => 'Stevan', birth_year => 1924);
30 is($whacko->name, 'Stevan');
31 is($whacko->birth_year, 1924);
32 is($whacko->favorite_language, 'Perl');
34 $whacko->name('Stevan Little');
35 $whacko->favorite_language('C#'); # he's dead to us now..
38 $whacko->birth_year(1922);
39 } qr/read-only accessor/;
41 is($whacko->name, 'Stevan Little');
42 is($whacko->favorite_language, 'C#');