Commits

Shlomi Fish  committed a8c0901

Implement ::ModuleList->format_as.

  • Participants
  • Parent commits 952c3cd

Comments (0)

Files changed (2)

File Module-Format/Module-Format/lib/Module/Format/ModuleList.pm

     return [ @{$self->_modules()} ];
 }
 
+=head2 my $array_ref_of_strings = $list->format_as($format)
+
+Returns a list containing all the modules formatted in the $format . See
+L<Module::Format::Module> for the available formats.
+
+=cut
+
+sub format_as
+{
+    my ($self, $format) = @_;
+
+    return [map { $_->format_as($format) } @{$self->_modules()}];
+}
+
 =head1 AUTHOR
 
 Shlomi Fish, L<http://www.shlomifish.org/>

File Module-Format/Module-Format/t/module-list.t

 use strict;
 use warnings;
 
-use Test::More tests => 4;
+use Test::More tests => 5;
 
 use Module::Format::ModuleList;
 
         );
 
     }
+
+    # TEST
+    is_deeply(
+        $list->format_as('rpm_dash'),
+        [qw(perl-XML-RSS perl-Data-Dumper)],
+        'format_as on list is working.',
+    );
 }