File Coverage

gen/syn-PerlBean_Collection.pl
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
1 1     1   565 use strict;
  1         2  
  1         30  
2 1     1   799 use PerlBean;
  1         3  
  1         31  
3 1     1   623 use PerlBean::Collection;
  1         3  
  1         29  
4 1     1   446 use PerlBean::Attribute::Factory;
  1         3  
  1         153  
5              
6             my $bean = PerlBean->new( {
7             package => 'Athlete',
8             } );
9             my $factory = PerlBean::Attribute::Factory->new();
10             my $attr = $factory->create_attribute( {
11             method_factory_name => 'name',
12             short_description => 'the name of the athlete',
13             } );
14             $bean->add_method_factory($attr);
15              
16             my $bean2 = PerlBean->new( {
17             package => 'Cyclist',
18             base => [ qw(Athlete)],
19             } );
20             my $factory = PerlBean::Attribute::Factory->new();
21             my $attr2 = $factory->create_attribute( {
22             method_factory_name => 'cycle',
23             short_description => 'the cyclist\'s cycle',
24             } );
25             $bean2->add_method_factory($attr2);
26              
27             my $collection = PerlBean::Collection->new();
28             $collection->add_perl_bean($bean);
29             $collection->add_perl_bean($bean2);
30             $collection->write('tmp');
31             1;