|
NAMETest2::Manual::Testing - Hub for documentation about writing tests with Test2.DESCRIPTIONThis document outlines all the tutorials and POD that cover writing tests. This section does not cover any Test2 internals, nor does it cover how to write new tools, for that see Test2::Manual::Tooling.NAMESPACE MAPWhen writing tests there are a couple namespaces to focus on:
LISTING DEPENDENCIESWhen you use Test2, specifically things included in Test2::Suite you need to list them in your modules test dependencies. It is important to note that you should list the tools/plugins/bundles you need, you should not simply list Test2::Suite as your dependency. Test2::Suite is a living distribution intended to represent the "current" best practices. As tools, plugins, and bundles evolve, old ones will become discouraged and potentially be moved from Test2::Suite into their own distributions.One goal of Test2::Suite is to avoid breaking backwards compatibility. Another goal is to always improve by replacing bad designs with better ones. When necessary Test2::Suite will break old modules out into separate dists and define new ones, typically with a new bundle. In short, if we feel the need to break something we will do so by creating a new bundle, and discouraging the old one, but we will not break the old one. So for example, if you use Test2::V0, and Dist::Zilla you should have this in your config: [Prereqs / TestRequires] Test2::V0 = 0.000060 You SHOULD NOT do this: [Prereqs / TestRequires] Test2::Suite = 0.000060 Because Test2::V0 might not always be part of Test2::Suite. When writing new tests you should often check Test2::Suite to see what the current recommended bundle is. Dist::Zilla [Prereqs / TestRequires] Test2::V0 = 0.000060 ExtUtils::MakeMaker my %WriteMakefileArgs = ( ..., "TEST_REQUIRES" => { "Test2::V0" => "0.000060" }, ... ); Module::Install test_requires 'Test2::V0' => '0.000060'; Module::Build my $build = Module::Build->new( ..., test_requires => { "Test2::V0" => "0.000060", }, ... ); TUTORIALSSIMPLE/INTRODUCTION TUTORIALTest2::Manual::Testing::Introduction is an introduction to writing tests using the Test2 tools.MIGRATING FROM TEST::BUILDER and TEST::MORETest2::Manual::Testing::Migrating Is a tutorial for converting old tests that use Test::Builder or Test::More to the newer Test2 way of doing things.ADVANCED PLANNINGTest2::Manual::Testing::Planning is a tutorial on the many ways to set a plan.TODO TESTSTest2::Manual::Testing::Todo is a tutorial for markings tests as TODO.SUBTESTSCOMING SOON.COMPARISONSCOMING SOON.SIMPLE COMPARISONS COMING SOON. ADVANCED COMPARISONS COMING SOON. TESTING EXPORTERSCOMING SOON.TESTING CLASSESCOMING SOON.TRAPPINGCOMING SOON.TRAPPING EXCEPTIONS COMING SOON. TRAPPING WARNINGS COMING SOON. DEFERRED TESTINGCOMING SOON.MANAGING ENCODINGSCOMING SOON.AUTO-ABORT ON FAILURECOMING SOON.CONTROLLING RANDOM BEHAVIORCOMING SOON.WRITING YOUR OWN BUNDLECOMING SOON.TOOLSET DOCUMENTATIONCOMING SOON.PLUGIN DOCUMENTATIONCOMING SOON.BUNDLE DOCUMENTATIONCOMING SOON.REQUIRE DOCUMENTATIONCOMING SOON.SEE ALSOTest2::Manual - Primary index of the manual.SOURCEThe source code repository for Test2-Manual can be found at https://github.com/Test-More/Test2-Suite/.MAINTAINERS
AUTHORS
COPYRIGHTCopyright 2018 Chad Granum <exodist@cpan.org>.This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/
Visit the GSP FreeBSD Man Page Interface. |