|
NAMETest::Group::Tester - Test Test::Group extensions VERSIONTest::Group::Tester version 0.01 SYNOPSIS use Test::More tests => 1;
use Test::Group::Tester;
testscript_ok('#line '.(__LINE__+1)."\n".<<'EOSCRIPT', 3);
use Test::More;
use Test::Group;
# Test a passing test group
want_test('pass', "this_should_pass");
test this_should_pass => sub {
ok 1, "1 is true";
ok 2, "2 is true";
};
# Test a failing test group
want_test('fail', "this_should_fail",
fail_diag("0 is true", 0, __LINE__+5),
fail_diag("this_should_fail", 1, __LINE__+5),
);
test this_should_fail => sub {
ok 1, "1 is true";
ok 0, "0 is true";
};
# Test a skipped test group
want_test('skip', "just because I can");
skip_next_test("just because I can");
test this_should_be_skipped => sub {
ok 0;
};
EOSCRIPT
DESCRIPTIONTest the behavior of a Test::Harness compatible test script, by spawning an external process to run the script and capturing its STDOUT and STDERR. Includes support for matching the failed test diagnostic messages produced by Test::Group and Test::Builder. Useful when writing tests for Test::Group extension modules, see Test::Group::Extending. This module is used within the test suite of Test::Group itself, so several usage examples can be found by searching for "testscript_ok" in the files in Test::Group's t subdirectory. FUNCTIONS EXPORTED BY DEFAULT
TEST SCRIPT FUNCTIONSThe following functions are for use from within the script under test. They are not exported by default.
AUTHORSNick Cleaton <ncleaton@cpan.org> Dominique Quatravaux <domq@cpan.org> LICENSECopyright (c) 2009 by Nick Cleaton and Dominique Quatravaux 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.1 or, at your option, any later version of Perl 5 you may have available.
|