1Test::DZil(3) User Contributed Perl Documentation Test::DZil(3)
2
3
4
6 Test::DZil - tools for testing Dist::Zilla plugins
7
9 version 4.300002
10
12 Test::DZil provides routines for writing tests for Dist::Zilla plugins.
13
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.
28
29 is_yaml
30 is_yaml( $yaml_string, $want_struct, $comment );
31
32 This test assertion deserializes the given YAML string and does a
33 "cmp_deeply".
34
35 is_json
36 is_json( $json_string, $want_struct, $comment );
37
38 This test assertion deserializes the given JSON string and does a
39 "cmp_deeply".
40
41 dist_ini
42 my $ini_text = dist_ini(\%root_config, @plugins);
43
44 This routine returns a string that could be used to populate a simple
45 dist.ini file. The %root_config gives data for the "root" section of
46 the configuration. To provide a line multiple times, provide an
47 arrayref. For example, the root section could read:
48
49 {
50 name => 'Dist-Sample',
51 author => [
52 'J. Smith <jsmith@example.com>',
53 'Q. Smith <qsmith@example.com>',
54 ],
55 }
56
57 The root section is optional.
58
59 Plugins can be given in a few ways:
60
61 "PluginMoniker"
62 "[ "PluginMoniker" ]"
63 These become "[PluginMoniker]"
64
65 "[ "PluginMoniker", "PluginName" ]"
66 This becomes "[PluginMoniker / PluginName]"
67
68 "[ "PluginMoniker", { ... } ]"
69 "[ "PluginMoniker", "PluginName", { ... } ]"
70 These use the given hashref as the parameters inside the section,
71 with the same semantics as the root section.
72
73 simple_ini
74 This behaves exactly like "dist_ini", but it merges any given root
75 config into a starter config, which means that you can often skip any
76 explicit root config. The starter config may change slightly over
77 time, but is something like this:
78
79 {
80 name => 'DZT-Sample',
81 abstract => 'Sample DZ Dist',
82 version => '0.001',
83 author => 'E. Xavier Ample <example@example.org>',
84 license => 'Perl_5',
85 copyright_holder => 'E. Xavier Ample',
86 }
87
89 Ricardo SIGNES <rjbs@cpan.org>
90
92 This software is copyright (c) 2011 by Ricardo SIGNES.
93
94 This is free software; you can redistribute it and/or modify it under
95 the same terms as the Perl 5 programming language system itself.
96
97
98
99perl v5.12.4 2011-09-22 Test::DZil(3)