Permalink
Browse files

Rename to DZP::Test::UnusedVars

  • Loading branch information...
1 parent 98aa10b commit 197970626c1f5a40819b45e35e09ad87c98e9e05 @doherty committed Aug 27, 2011
Showing with 325 additions and 31 deletions.
  1. +2 −0 .gitignore
  2. +50 −0 Build.PL
  3. +1 −0 Changes
  4. +67 −0 Makefile.PL
  5. +54 −0 README
  6. +3 −0 corpus/DZ1/.netrc
  7. +11 −0 corpus/DZ1/dist.ini
  8. +10 −0 corpus/DZ1/lib/DZ1.pm
  9. +5 −3 dist.ini
  10. +43 −0 lib/Dist/Zilla/Plugin/Test/UnusedVars.pm
  11. +14 −28 lib/Dist/Zilla/Plugin/UnusedVarsTests.pm
  12. +36 −0 t/deprecated.t
  13. +29 −0 t/everything.t
View
@@ -1 +1,3 @@
Dist-Zilla-Plugin-UnusedVarsTests-*
+.build
+Dist-Zilla-Plugin-Test-UnusedVars-*
View
@@ -0,0 +1,50 @@
+
+use strict;
+use warnings;
+
+use Module::Build 0.3601;
+
+
+my %module_build_args = (
+ "build_requires" => {
+ "File::Find" => 0,
+ "File::Path" => 0,
+ "File::Temp" => 0,
+ "Module::Build" => "0.3601",
+ "Moose::Autobox" => 0,
+ "Test::DZil" => 0,
+ "Test::More" => "0.96",
+ "Test::Output" => 0,
+ "autodie" => 0
+ },
+ "configure_requires" => {
+ "ExtUtils::MakeMaker" => "6.30",
+ "Module::Build" => "0.3601"
+ },
+ "dist_abstract" => "Release tests for unused variables",
+ "dist_author" => [
+ "Marcel Gr\303\274nauer <marcel\@cpan.org>",
+ "Mike Doherty <doherty\@cpan.org>"
+ ],
+ "dist_name" => "Dist-Zilla-Plugin-Test-UnusedVars",
+ "dist_version" => "v2.0.0",
+ "license" => "perl",
+ "module_name" => "Dist::Zilla::Plugin::Test::UnusedVars",
+ "recommends" => {},
+ "recursive_test_files" => 1,
+ "requires" => {
+ "Dist::Zilla::Plugin::InlineFiles" => 0,
+ "Moose" => 0,
+ "Test::Vars" => 0,
+ "namespace::autoclean" => 0,
+ "perl" => "5.008",
+ "strict" => 0,
+ "warnings" => 0
+ },
+ "script_files" => []
+);
+
+
+my $build = Module::Build->new(%module_build_args);
+
+$build->create_build_script;
View
@@ -1,6 +1,7 @@
Revision history for Perl extension {{$dist->name}}
{{$NEXT}}
+ - Rename to Dist::Zilla::Plugin::Test::UnusedVars
1.100860 2010-03-27 23:36:51 Europe/Vienna
- original version
View
@@ -0,0 +1,67 @@
+
+use strict;
+use warnings;
+
+use 5.008;
+
+use ExtUtils::MakeMaker 6.30;
+
+
+
+my %WriteMakefileArgs = (
+ "ABSTRACT" => "Release tests for unused variables",
+ "AUTHOR" => "Marcel Gr\303\274nauer <marcel\@cpan.org>, Mike Doherty <doherty\@cpan.org>",
+ "BUILD_REQUIRES" => {
+ "File::Find" => 0,
+ "File::Path" => 0,
+ "File::Temp" => 0,
+ "Module::Build" => "0.3601",
+ "Moose::Autobox" => 0,
+ "Test::DZil" => 0,
+ "Test::More" => "0.96",
+ "Test::Output" => 0,
+ "autodie" => 0
+ },
+ "CONFIGURE_REQUIRES" => {
+ "ExtUtils::MakeMaker" => "6.30",
+ "Module::Build" => "0.3601"
+ },
+ "DISTNAME" => "Dist-Zilla-Plugin-Test-UnusedVars",
+ "EXE_FILES" => [],
+ "LICENSE" => "perl",
+ "NAME" => "Dist::Zilla::Plugin::Test::UnusedVars",
+ "PREREQ_PM" => {
+ "Dist::Zilla::Plugin::InlineFiles" => 0,
+ "Moose" => 0,
+ "Test::Vars" => 0,
+ "namespace::autoclean" => 0,
+ "strict" => 0,
+ "warnings" => 0
+ },
+ "VERSION" => "v2.0.0",
+ "test" => {
+ "TESTS" => "t/*.t"
+ }
+);
+
+
+unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
+ my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
+ my $pp = $WriteMakefileArgs{PREREQ_PM};
+ for my $mod ( keys %$br ) {
+ if ( exists $pp->{$mod} ) {
+ $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
+ }
+ else {
+ $pp->{$mod} = $br->{$mod};
+ }
+ }
+}
+
+delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
+ unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
+
+WriteMakefile(%WriteMakefileArgs);
+
+
+
View
54 README
@@ -0,0 +1,54 @@
+NAME
+ Dist::Zilla::Plugin::Test::UnusedVars - Release tests for unused
+ variables
+
+VERSION
+ version v2.0.0
+
+SYNOPSIS
+ In "dist.ini":
+
+ [Test::UnusedVars]
+
+DESCRIPTION
+ This is an extension of Dist::Zilla::Plugin::InlineFiles, providing the
+ following file:
+
+ xt/release/unused-vars.t - a standard Test::Vars test
+
+AVAILABILITY
+ The latest version of this module is available from the Comprehensive
+ Perl Archive Network (CPAN). Visit <http://www.perl.com/CPAN/> to find a
+ CPAN site near you, or see
+ <http://search.cpan.org/dist/Dist-Zilla-Plugin-Test-UnusedVars/>.
+
+ The development version lives at
+ <http://github.com/doherty/Dist-Zilla-Plugin-Test-UnusedVars> and may be
+ cloned from
+ <git://github.com/doherty/Dist-Zilla-Plugin-Test-UnusedVars.git>.
+ Instead of sending patches, please fork this project using the standard
+ git and github infrastructure.
+
+SOURCE
+ The development version is on github at
+ <http://github.com/doherty/Dist-Zilla-Plugin-Test-UnusedVars> and may be
+ cloned from
+ <git://github.com/doherty/Dist-Zilla-Plugin-Test-UnusedVars.git>
+
+BUGS AND LIMITATIONS
+ No bugs have been reported.
+
+ Please report any bugs or feature requests through the web interface at
+ <https://github.com/doherty/Dist-Zilla-Plugin-Test-UnusedVars/issues>.
+
+AUTHORS
+ * Marcel Grünauer <marcel@cpan.org>
+
+ * Mike Doherty <doherty@cpan.org>
+
+COPYRIGHT AND LICENSE
+ This software is copyright (c) 2010 by Mike Doherty.
+
+ This is free software; you can redistribute it and/or modify it under
+ the same terms as the Perl 5 programming language system itself.
+
View
@@ -0,0 +1,3 @@
+machine api.twitter.com
+ login jdoe@example.com
+ password example
View
@@ -0,0 +1,11 @@
+name = DZ1
+version = 0.001
+author = E. Xavier Ample <example@example.org>
+license = Perl_5
+copyright_holder = E. Xavier Ample
+
+[@Filter]
+bundle = @FakeClassic
+remove = ConfirmRelease
+remove = FakeRelease
+[FakeUploader]
View
@@ -0,0 +1,10 @@
+use strict;
+use warnings;
+package DZ1;
+# ABSTRACT: this is a sample package for testing Dist::Zilla;
+
+sub main {
+ return 1;
+}
+
+1;
View
@@ -1,7 +1,9 @@
-name = Dist-Zilla-Plugin-UnusedVarsTests
+name = Dist-Zilla-Plugin-Test-UnusedVars
copyright_year = 2010
+author = Marcel Grünauer <marcel@cpan.org>
+author = Mike Doherty <doherty@cpan.org>
-[@MARCEL]
+[@Author::DOHERTY]
-[Prereq]
+[Prereqs]
Test::Vars = 0
@@ -0,0 +1,43 @@
+use 5.008;
+use strict;
+use warnings;
+
+package Dist::Zilla::Plugin::Test::UnusedVars;
+# ABSTRACT: Release tests for unused variables
+# VERSION
+use Moose;
+extends 'Dist::Zilla::Plugin::InlineFiles';
+
+__PACKAGE__->meta->make_immutable;
+no Moose;
+1;
+
+=head1 SYNOPSIS
+
+In C<dist.ini>:
+
+ [Test::UnusedVars]
+
+=for test_synopsis
+1;
+__END__
+
+=head1 DESCRIPTION
+
+This is an extension of L<Dist::Zilla::Plugin::InlineFiles>, providing the
+following file:
+
+ xt/release/unused-vars.t - a standard Test::Vars test
+
+=cut
+
+__DATA__
+___[ xt/release/unused-vars.t ]___
+#!perl
+
+use Test::More;
+
+eval "use Test::Vars";
+plan skip_all => "Test::Vars required for testing unused vars"
+ if $@;
+all_vars_ok();
@@ -3,44 +3,30 @@ use strict;
use warnings;
package Dist::Zilla::Plugin::UnusedVarsTests;
-# ABSTRACT: Release tests for unused variables
+# ABSTRACT: (DEPRECATED) Release tests for unused variables
+# VERSION
use Moose;
-extends 'Dist::Zilla::Plugin::InlineFiles';
+use namespace::autoclean;
+extends 'Dist::Zilla::Plugin::Test::UnusedVars';
+
+before register_component => sub {
+ warn '!!! [UnusedVarsTests] is deprecated and will be removed in a future release; replace it with [Test::UnusedVars]';
+};
__PACKAGE__->meta->make_immutable;
no Moose;
1;
-=begin :prelude
-
-=for test_synopsis
-1;
-__END__
-
-=end :prelude
-
=head1 SYNOPSIS
-In C<dist.ini>:
-
- [UnusedVarsTests]
+Please use L<Dist::Zilla::Plugin::Test::UnusedVars> instead.
-=head1 DESCRIPTION
+In C<dist.ini>:
-This is an extension of L<Dist::Zilla::Plugin::InlineFiles>, providing the
-following file:
+ [Test::UnusedVars]
- xt/release/unused-vars.t - a standard Test::Vars test
+=for test_synopsis
+1;
+__END__
=cut
-
-__DATA__
-___[ xt/release/unused-vars.t ]___
-#!perl
-
-use Test::More;
-
-eval "use Test::Vars";
-plan skip_all => "Test::Vars required for testing unused vars"
- if $@;
-all_vars_ok();
View
@@ -0,0 +1,36 @@
+use strict;
+use warnings;
+use Test::More 0.96 tests => 2;
+use Test::Output;
+use autodie;
+use Test::DZil;
+use Moose::Autobox;
+
+my $tzil;
+
+stderr_like(
+ sub {
+ $tzil = Builder->from_config(
+ { dist_root => 'corpus/DZ1' },
+ { add_files => {
+ 'source/dist.ini' => simple_ini('GatherDir', 'UnusedVarsTests')
+ }
+ },
+ );
+ },
+ qr/^!!!.*deprecate/,
+ 'Got a deprecation warning'
+);
+
+$tzil->build;
+
+my @xtests = map $_->name =~ m{^xt/} ? $_->name : (), $tzil->files->flatten;
+ok(
+ (grep { $_ eq 'xt/release/unused-vars.t' } @xtests),
+ 'unused-vars.t exists'
+) or diag explain \@xtests;
+
+END { # Remove (empty) dir created by building the dists
+ require File::Path;
+ File::Path::rmtree('tmp');
+}
View
@@ -0,0 +1,29 @@
+use strict;
+use warnings;
+use Test::More 0.96 tests => 1;
+use autodie;
+use Test::DZil;
+use Moose::Autobox;
+
+my $tzil = Builder->from_config(
+ { dist_root => 'corpus/DZ1' },
+ {
+ add_files => {
+ 'source/dist.ini' => simple_ini(
+ ('GatherDir', 'Test::UnusedVars')
+ ),
+ },
+ },
+);
+$tzil->build;
+
+my @xtests = map $_->name =~ m{^xt/} ? $_->name : (), $tzil->files->flatten;
+ok(
+ (grep { $_ eq 'xt/release/unused-vars.t' } @xtests),
+ 'unused-vars.t exists'
+) or diag explain \@xtests;
+
+END { # Remove (empty) dir created by building the dists
+ require File::Path;
+ File::Path::rmtree('tmp');
+}

0 comments on commit 1979706

Please sign in to comment.