9 has 'attr1' => (is => 'ro', required => 1);
17 has 'attr2' => (is => 'ro', required => 1);
25 has 'attr3' => (is => 'ro', required => 1);
27 __PACKAGE__->meta->make_immutable;
30 foreach my $num (1..3) {
31 my $class = "Tower${num}";
32 my @attrs = map "attr$_", 1..$num;
33 my %args = map +($_ => "${_}_value"), @attrs;
34 my $obj = $class->new(%args);
35 is($obj->{$_}, "${_}_value", "Attribute $_ ok for $class") for @attrs;