File Coverage

lib/WWW/Mechanize/FormFiller/Value/Random/Chars.pm
Criterion Covered Total %
statement 37 48 77.0
branch 0 2 0.0
condition n/a
subroutine 10 10 100.0
pod 2 2 100.0
total 49 62 79.0


line stmt bran cond sub pod time code
1             package WWW::Mechanize::FormFiller::Value::Random::Chars;
2 1     1   548 use base 'WWW::Mechanize::FormFiller::Value';
  1         78  
  1         2  
3 1     1   3 use strict;
  1         135  
  1         30475  
4              
5 1     1   3 use vars qw( $VERSION );
  1         36  
  1         921  
6 1     1   4 use Data::Random qw(rand_chars);
  1         5009  
  1         7  
7             $VERSION = '0.11';
8              
9             sub new {
10 1     2 1 2 my ($class,$name,@args) = @_;
11 1         39 my $self = $class->SUPER::new($name);
12 1 0       1705 @args = (set => 'alpha', min => 5, max => 8) unless scalar @args;
13 1         19367 $self->{args} = [ @args ];
14 1         278 $self;
15             };
16              
17             sub value {
18 1     2 1 118 my ($self,$input) = @_;
19 1         3 join "", (rand_chars( @{$self->{args}} ));
  1         26  
20             };
21              
22             1;
23              
24             __END__