Mail::SPF::Test(3)

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

VERSION
1.001

SYNOPSIS
    use Mail::SPF::Test;

    my $test_suite = Mail::SPF::Test->new_from_yaml_file('rfc4408-tests.yml');

    foreach my $scenario ($test_suite->scenarios) {
        printf("Scenario '%s'\n", $scenario->description);

        foreach my $test_case ($scenario->test_cases) {
            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
Mail::SPF::Test is a class for reading and manipulating SPF test-suite data.

  Constructors
The following constructors are provided:

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

new_from_yaml($yaml_text, %options): returns Mail::SPF::Test
    Creates a new SPF test-suite object from the given YAML string.

new_from_yaml_file($file_name, %options): returns Mail::SPF::Test
    Creates a new SPF test-suite object by reading from the YAML file of the given name.

  Instance methods
The following instance methods are provided:

as_yaml: returns string
    Returns the test-suite object's list of scenarios formatted as a stream of YAML documents.

scenarios: returns list of Mail::SPF::Test::Scenario
    Returns a list of the test-suite object's scenario objects.

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

AUTHORS
Julian Mehnle <julian@mehnle.net>