1Test2::Plugin(3) User Contributed Perl Documentation Test2::Plugin(3)
2
3
4
6 Test2::Plugin - Documentation for plugins
7
9 Plugins are packages that cause behavior changes, or other side effects
10 for the test file that loads them. They should not export any
11 functions, or provide any tools. Plugins should be distinct units of
12 functionality.
13
14 If you wish to combine behavior changes with tools then you should
15 write a Plugin, a Tools module, and a bundle that loads them both.
16
18 Should I subclass Test2::Plugin?
19 No. Currently this class is empty. Eventually we may want to add
20 behavior, in which case we do not want anyone to already be
21 subclassing it.
22
24 Writing a plugin is not as simple as writing an Test2::Bundle, or
25 writing Test2::Tools. Plugins alter behavior, or cause desirable side-
26 effects. To accomplish this you typically need a custom import() method
27 that calls one or more functions provided by the Test2::API package.
28
29 If you want to write a plugin you should look at existing plugins, as
30 well as the Test2::API and Test2::Hub documentation. There is no
31 formula for a Plugin, they are generally unique, however consistent
32 rules are that they should not load other plugins, or export any
33 functions.
34
36 The source code repository for Test2-Suite can be found at
37 https://github.com/Test-More/Test2-Suite/.
38
40 Chad Granum <exodist@cpan.org>
41
43 Chad Granum <exodist@cpan.org>
44
46 Copyright 2018 Chad Granum <exodist@cpan.org>.
47
48 This program is free software; you can redistribute it and/or modify it
49 under the same terms as Perl itself.
50
51 See http://dev.perl.org/licenses/
52
53
54
55perl v5.36.0 2023-03-23 Test2::Plugin(3)