Mail::SPF::Test::Case(3)

NAME
Mail::SPF::Test::Case - SPF test-suite test case class

SYNOPSIS
    use Mail::SPF::Test::Case;

    my $test_case   = Mail::SPF::Test::Case->new_from_yaml_struct($struct);

    my $name        = $test_case->name;
    my $description = $test_case->description;
    my $comment     = $test_case->comment;
    my @spec_refs   = $test_case->spec_refs(undef || '*.*/*');

    my $scope       = $test_case->scope;
    my $identity    = $test_case->identity;

    my $ip_address  = $test_case->ip_address;
    my $helo_identity
                    = $test_case->helo_identity;

    my $expected_results
                    = $test_case->expected_results;
    my $expected_explanation
                    = $test_case->expected_explanation;

    my $ok =
        $test_case->is_expected_result($result_code) and
        $expected_explanation eq $authority_explanation;

DESCRIPTION
An object of class Mail::SPF::Test::Case represents a single test case within an SPF test-suite scenario.

  Constructors
The following constructors are provided:

new(%options): returns Mail::SPF::Test::Case
    Creates a new SPF test-suite test case object from scratch.

new_from_yaml_struct($yaml_struct): returns Mail::SPF::Test::Case
    Creates a new SPF test-suite test case object from the given YAML-generated data structure.

  Instance methods
The following instance methods are provided:

name: returns string
    Returns the name of the test case.

description: returns string
    Returns the description of the test case.

comment: returns string
    Returns the optional comment of the test case.

spec_refs: returns list of string
    Returns a list of the specification references for the test case.

scope: returns string
    Returns the SPF identity's scope for the test case.

identity: returns string
    Returns the SPF identity for the test case.

ip_address: returns string
    Returns the SMTP sender's IP address for the test case.

helo_identity: returns string
    Returns the SPF "HELO" identity for the test case.

expected_results: returns list of string
    Returns the list of acceptable SPF result codes for the test case.

is_expected_result($result_code): returns boolean
    Returns true if the given result code is among the acceptable SPF result codes for the test case, false otherwise.

expected_explanation: returns string
    Returns the expected authority explanation string for the test case.

SEE ALSO
Mail::SPF::Test

For availability, support, and license information, see the README file included with Mail::SPF::Test.

AUTHORS
Julian Mehnle <julian@mehnle.net>