File Coverage

lib/WWW/Mechanize/FormFiller/Value/Random/Word.pm
Criterion Covered Total %
statement 38 49 77.5
branch 0 4 0.0
condition n/a
subroutine 9 9 100.0
pod 2 2 100.0
total 49 64 76.5


line stmt bran cond sub pod time code
1             package WWW::Mechanize::FormFiller::Value::Random::Word;
2 1     2   457 use base 'WWW::Mechanize::FormFiller::Value';
  1         60  
  1         2  
3              
4 1     2   3 use vars qw( $VERSION );
  1         109  
  1         22617  
5 1     2   2 use Data::Random qw(rand_words);
  1         24  
  1         700  
6             $VERSION = '0.11';
7              
8             sub new {
9 2     5 1 4 my ($class,$name,@args) = @_;
10 2         76 my $self = $class->SUPER::new($name);
11 2 0       846 @args = (size => 1) unless scalar @args;
12 2         3830 $self->{args} = [ @args ];
13 2         383 $self;
14             };
15              
16             sub value {
17 1     5 1 103 my ($self,$input) = @_;
18 1         2 return join " ", @{rand_words( @{$self->{args}} )};
  1         22  
  1         10  
19             };
20              
21             1;
22              
23             __END__