1Test::DZil(3)         User Contributed Perl Documentation        Test::DZil(3)
2
3
4

NAME

6       Test::DZil - tools for testing Dist::Zilla plugins
7

VERSION

9       version 6.017
10

DESCRIPTION

12       Test::DZil provides routines for writing tests for Dist::Zilla plugins.
13

FUNCTIONS

15   Builder
16   Minter
17         my $tzil = Builder->from_config(...);
18
19       These return class names that subclass Dist::Zilla::Dist::Builder or
20       Dist::Zilla::Dist::Minter, respectively, with the Dist::Zilla::Tester
21       behavior added.
22
23   is_filelist
24         is_filelist( \@files_we_have, \@files_we_want, $desc );
25
26       This test assertion compares two arrayrefs of filenames, taking care of
27       slash normalization and sorting.  @files_we_have may also contain
28       objects that do Dist::Zilla::Role::File.
29
30   is_yaml
31         is_yaml( $yaml_string, $want_struct, $comment );
32
33       This test assertion deserializes the given YAML string and does a
34       "cmp_deeply".
35
36   is_json
37         is_json( $json_string, $want_struct, $comment );
38
39       This test assertion deserializes the given JSON string and does a
40       "cmp_deeply".
41
42   dist_ini
43         my $ini_text = dist_ini(\%root_config, @plugins);
44
45       This routine returns a string that could be used to populate a simple
46       dist.ini file.  The %root_config gives data for the "root" section of
47       the configuration.  To provide a line multiple times, provide an
48       arrayref.  For example, the root section could read:
49
50         {
51           name   => 'Dist-Sample',
52           author => [
53             'J. Smith <jsmith@example.com>',
54             'Q. Smith <qsmith@example.com>',
55           ],
56         }
57
58       The root section is optional.
59
60       Plugins can be given in a few ways:
61
62       "PluginMoniker"
63       "[ "PluginMoniker" ]"
64           These become "[PluginMoniker]"
65
66       "[ "PluginMoniker", "PluginName" ]"
67           This becomes "[PluginMoniker / PluginName]"
68
69       "[ "PluginMoniker", { ... } ]"
70       "[ "PluginMoniker", "PluginName", { ... } ]"
71           These use the given hashref as the parameters inside the section,
72           with the same semantics as the root section.
73
74   simple_ini
75       This behaves exactly like "dist_ini", but it merges any given root
76       config into a starter config, which means that you can often skip any
77       explicit root config.  The starter config may change slightly over
78       time, but is something like this:
79
80         {
81           name     => 'DZT-Sample',
82           abstract => 'Sample DZ Dist',
83           version  => '0.001',
84           author   => 'E. Xavier Ample <example@example.org>',
85           license  => 'Perl_5',
86           copyright_holder => 'E. Xavier Ample',
87         }
88

AUTHOR

90       Ricardo SIGNES 😏 <rjbs@cpan.org>
91
93       This software is copyright (c) 2020 by Ricardo SIGNES.
94
95       This is free software; you can redistribute it and/or modify it under
96       the same terms as the Perl 5 programming language system itself.
97
98
99
100perl v5.32.0                      2020-11-03                     Test::DZil(3)
Impressum