File Coverage

blib/lib/WWW/Webrobot/AssertConstant.pm
Criterion Covered Total %
statement 12 14 85.7
branch 1 2 50.0
condition 1 3 33.3
subroutine 3 4 75.0
pod 0 2 0.0
total 17 25 68.0


line stmt bran cond sub pod time code
1             package WWW::Webrobot::AssertConstant;
2 1     1   4 use strict;
  1         2  
  1         23  
3 1     1   4 use warnings;
  1         1  
  1         116  
4              
5              
6             # Author: Stefan Trcek
7             # Copyright(c) 2004-2006 ABAS Software AG
8              
9             =head1 NAME
10              
11             WWW::Webrobot::AssertConstant - assert object for constant values
12              
13             =head1 SYNOPSIS
14              
15             For internal use only.
16              
17             =head1 DESCRIPTION
18              
19             The 'check' method of this class returns the values given in the constructor 'new'.
20              
21             =cut
22              
23              
24             sub new {
25 1     1 0 3 my ($class) = shift;
26 1   33     12 my $self = bless({}, ref($class) || $class);
27              
28 1         2 my ($fail, $fail_str) = @_;
29 1 50       11 $self->{fail} = $fail ? 1 : 0;
30 1         3 $self->{fail_str} = $fail_str;
31              
32 1         4 return $self;
33             }
34              
35             sub check {
36 0     0 0   my ($self, $r) = @_;
37 0           return ($self->{fail}, [ $self->{fail_str} ]);
38             }
39              
40              
41             1;