NAME

Test::A8N::File - Storytest file object

SYNOPSIS

my $file = Test::A8N::File->new({
    filename     => "cases/test1.tc",
    file_root    => $a8n->file_root,
    fixture_base => $a8n->fixture_base,
});
$file->run_tests();

DESCRIPTION

This class is used to represent and run tests within individual storytest files. For more information, please see Test::A8N.

METHODS

Accessors

filename

The filename that this object is supposed to represent.

fixture_base

See "fixture_base" in Test::A8N.

file_root

See "file_root" in Test::A8N.

verbose

See "verbose" in Test::A8N.

testcase_class

Used to set the class used to store testcases.

Default: Test::A8N::TestCase

Object Methods

run_tests

This iterates over each of the "cases" and will create a Test::FITesque::Test test runner for test case. If you call this method with a testcase ID, it will only run that one testcase.

data

Returns the raw datastructure of the YAML file.

cases

Returns objects representing each testcase within this test file. Unless "testcase_class" is overridden, this property returns instances of the Test::A8N::TestCase class.

fixture_class

This locates the fixture class used to run testcases. The resulting class is called whenever a test action needs to be run.

If the "filename" of this test is one or more sub-directories below the "file_root", then it will append the directory name to the "fixture_base", and will use it as part of the class name. It works its way up the directory hierarchy until it finds a valid Perl class. If no such classes can be found, it will use the value of "fixture_base".

SEE ALSO

Test::A8N::TestCase, Test::FITesque::Test

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.