WWW::Webrobot::AssertConstant - assert object for constant values


webrobot documentation Contained in the webrobot distribution.

Index


Code Index:

NAME

Top

WWW::Webrobot::AssertConstant - assert object for constant values

SYNOPSIS

Top

For internal use only.

DESCRIPTION

Top

The 'check' method of this class returns the values given in the constructor 'new'.


webrobot documentation Contained in the webrobot distribution.

package WWW::Webrobot::AssertConstant;
use strict;
use warnings;


# Author: Stefan Trcek
# Copyright(c) 2004-2006 ABAS Software AG


sub new {
    my ($class) = shift;
    my $self = bless({}, ref($class) || $class);

    my ($fail, $fail_str) = @_;
    $self->{fail} = $fail ? 1 : 0;
    $self->{fail_str} = $fail_str;

    return $self;
}

sub check {
    my ($self, $r) = @_;
    return ($self->{fail}, [ $self->{fail_str} ]);
}


1;