File Coverage

lib/Dist/Zilla/Plugin/Author/GSG/HasVersionTests.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Dist::Zilla::Plugin::Author::GSG::HasVersionTests;;
2 2     2   527163 use Moose;
  2         467791  
  2         13  
3             extends 'Dist::Zilla::Plugin::InlineFiles';
4              
5 2     2   15040 use namespace::autoclean;
  2         6  
  2         32  
6              
7             # ABSTRACT: Appropriate errors for missing $VERSIONs in GSG dists
8 2     2   185 use version;
  2         15  
  2         40  
9             our $VERSION = 'v0.5.2'; # VERSION
10              
11             __PACKAGE__->meta->make_immutable;
12             1;
13              
14             #pod =head1 SYNOPSIS
15             #pod
16             #pod If you don't want the whole L<Dist::Zilla::PluginBundle::Author::GSG>
17             #pod you can get the C<author/has-version.t>
18             #pod by adding this Plugin to your C<dist.ini>.
19             #pod
20             #pod name = Foo-Bar-GSG
21             #pod [@Basic]
22             #pod [Author::GSG::HasVersionTests]
23             #pod
24             #pod =head1 DESCRIPTION
25             #pod
26             #pod Provides an author test file that runs L<Test::HasVersion/pm_version_ok>
27             #pod against C<all_pm_files> found by that module.
28             #pod If any fail a diagnostic message explaining that the files need
29             #pod to have C<# VERSION> comments due to our use of
30             #pod L<Dist::Zilla::Plugin::OurPkgVersion>.
31             #pod
32             #pod =head1 SEE ALSO
33             #pod
34             #pod L<Test::HasVersion>
35             #pod
36             #pod L<Dist::Zilla::Plugin::HasVersionTests>
37             #pod
38             #pod =cut
39              
40             =pod
41              
42             =encoding UTF-8
43              
44             =head1 NAME
45              
46             Dist::Zilla::Plugin::Author::GSG::HasVersionTests - Appropriate errors for missing $VERSIONs in GSG dists
47              
48             =head1 VERSION
49              
50             version v0.5.2
51              
52             =head1 SYNOPSIS
53              
54             If you don't want the whole L<Dist::Zilla::PluginBundle::Author::GSG>
55             you can get the C<author/has-version.t>
56             by adding this Plugin to your C<dist.ini>.
57              
58             name = Foo-Bar-GSG
59             [@Basic]
60             [Author::GSG::HasVersionTests]
61              
62             =head1 DESCRIPTION
63              
64             Provides an author test file that runs L<Test::HasVersion/pm_version_ok>
65             against C<all_pm_files> found by that module.
66             If any fail a diagnostic message explaining that the files need
67             to have C<# VERSION> comments due to our use of
68             L<Dist::Zilla::Plugin::OurPkgVersion>.
69              
70             =head1 SEE ALSO
71              
72             L<Test::HasVersion>
73              
74             L<Dist::Zilla::Plugin::HasVersionTests>
75              
76             =head1 AUTHOR
77              
78             Grant Street Group <developers@grantstreet.com>
79              
80             =head1 COPYRIGHT AND LICENSE
81              
82             This software is Copyright (c) 2019 - 2023 by Grant Street Group.
83              
84             This is free software, licensed under:
85              
86             The Artistic License 2.0 (GPL Compatible)
87              
88             =cut
89              
90             __DATA__
91             ___[ xt/author/has-version.t ]___
92             #!perl
93             # This file was automatically generated by Dist::Zilla::Plugin::Author::GSG::HasVersionTests.
94             use strict;
95             use warnings;
96              
97             use Test::More;
98              
99             eval "use Test::HasVersion";
100             plan skip_all =>
101             'Test::HasVersion required for testing for version numbers' if $@;
102              
103             my $failed = 0;
104              
105             for (all_pm_files()) {
106             pm_version_ok($_) or $failed = 1;
107             }
108              
109             diag(<<'EOL') if $failed;
110             To address these failed HasVersion tests, when using Author::GSG derived
111             Dist::Zilla PluginBundles, you should add a `# VERSION` comment to be used by
112             the OurPkgVersion Plugin.
113              
114             See the documetation for Dist::Zilla::Plugin::Author::GSG::HasVersionTests
115             for further details.
116             EOL
117              
118             done_testing