NAME
Test::A8N::TestCase - Storytest testcase object
SYNOPSIS
my $tc = Test::A8N::TestCase->new({
data => [ ... ],
index => ++$idx,
filename => "cases/test1.tc",
});
DESCRIPTION
This represents an individual testcase within a test file. It encapsulates the logic around parsing test instructions, sorting them and processing their arguments in such a way that they are readable by Test::FITesque::Test.
METHODS
Data Accessors
- id
-
Returns the
ID
property from the testcase data. If none is supplied, it generates an ID from the testcase "name" property. - name
-
Returns the
NAME
property from the testcase data. - summary
-
Returns the
SUMMARY
property from the testcase data. -
Returns an array of the
TAGS
list from the testcase data. An example of the expected syntax is:TAGS: - clustering - smoke
- expected
-
Returns an array of the
EXPECTED
list from the testcase data. - configuration
-
Returns an array of the
CONFIGURATION
list from the testcase data. This can be used by fixtures to load additional configuration that may be needed to run your test. - preconditions
-
Returns an array of the
PRECONDITIONS
list, used by "test_data" to compose a list of fixture calls. - postconditions
-
Returns an array of the
POSTCONDITIONS
list, used by "test_data" to compose a list of fixture calls. - instructions
-
Returns an array of the
INSTRUCTIONS
list, used by "test_data" to compose a list of fixture calls.
Object Methods
- data
-
Returns the raw datastructure of the YAML file.
- test_data
-
Assembles the results from "preconditions", "instructions", and "postconditions" and, using "parse_data", returns a data structure that Test::FITesque::Test can process.
- parse_data
-
Scrubs the arguments to test statements into a format that Test::FITesque::Test can process.
SEE ALSO
AUTHORS
Michael Nachbaur <mike@nachbaur.com>, Scott McWhirter <konobi@cpan.org>
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.
COPYRIGHT
Copyright (C) 2008 Sophos, Plc.