NAME

Mail::SPF::Test::Scenario - SPF test-suite scenario class

SYNOPSIS

use Mail::SPF::Test::Scenario;

my $scenario = Mail::SPF::Test::Scenario->new_from_yaml_struct($struct);

my $yaml        = $scenario->as_yaml;

my $description = $scenario->description;
my @test_cases  = $scenario->test_cases;
my @spec_refs   = $scenario->spec_refs(undef || '*.*/*');
my @records     = $scenario->records;
my @records_for_domain
                = $scenario->records_for_domain($domain, $rr_type);

DESCRIPTION

An object of class Mail::SPF::Test::Scenario represents an SPF test-suite scenario.

Constructors

The following constructors are provided:

new(%options): returns Mail::SPF::Test::Scenario

Creates a new SPF test-suite scenario object from scratch.

new_from_yaml_struct($yaml_struct, %options): returns Mail::SPF::Test::Scenario

Creates a new SPF test-suite scenario object from the given YAML-generated data structure.

new_from_yaml($yaml_text, %options): returns Mail::SPF::Test::Scenario

Creates a new SPF test-suite scenario object from the given YAML string.

Instance methods

The following instance methods are provided:

as_yaml: returns string

Returns the test-suite scenario formatted as a YAML document.

description: returns string

Returns the description of the test-suite scenario.

test_cases: returns list of Mail::SPF::Test::Case

Returns a list of the test-suite scenario object's test case objects.

spec_refs: returns list of string
spec_refs($granularity): returns list of string

Returns a combined and sorted list of the specification references of all the test-suite scenario object's test case objects.

See "spec_refs" in Mail::SPF::Test::Case for how to specify a granularity for the specification references.

records: returns list of Net::DNS::RR and DNS status tokens

Returns a list of the test-suite scenario object's DNS RR objects and DNS status tokens.

See "records_for_domain" for the description of DNS RR objects and DNS status tokens.

records_for_domain($domain): returns list of Net::DNS::RR and DNS status tokens
records_for_domain($domain, $type): returns list of Net::DNS::RR and DNS status tokens

Returns either the DNS RR objects of the test-suite scenario object that match the given domain and, if specified, RR type, or a DNS status token.

DNS RR objects are of type Net::DNS::RR. A DNS status token is any of 'TIMEOUT' or 'RCODE#' (where # is a digit from 1 to 5).

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>