Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Provide deprecation warnings

This allows people to use the old name and still have things
work while they update their pluginbundles and dist.ini files.
  • Loading branch information...
commit df3e6c16135e096be7c66e7f40a33a6b4a3e31c0 1 parent a7dc5f1
@doherty doherty authored
View
1  Changes
@@ -1,6 +1,7 @@
Revision history for Perl extension {{$dist->name}}
{{$NEXT}}
+ - Provide a deprecation warning (Mike Doherty)
1.112410 2011-08-29 09:57:31 America/Boise
- Made pod coverage test pass ( HarleyPig )
View
3  corpus/DZ1/.netrc
@@ -0,0 +1,3 @@
+machine api.twitter.com
+ login jdoe@example.com
+ password example
View
11 corpus/DZ1/dist.ini
@@ -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
10 corpus/DZ1/lib/DZ1.pm
@@ -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
42 lib/Dist/Zilla/Plugin/KwaliteeTests.pm
@@ -0,0 +1,42 @@
+use 5.008;
+use strict;
+use warnings;
+
+package Dist::Zilla::Plugin::KwaliteeTests;
+# ABSTRACT: (DEPRECATED) Release tests for kwalitee
+use Moose;
+extends 'Dist::Zilla::Plugin::Test::Kwalitee';
+
+=begin :prelude
+
+=for test_synopsis
+1;
+__END__
+
+=end :prelude
+
+=head1 SYNOPSIS
+
+In C<dist.ini>:
+
+ [Test::Kwalitee]
+ skiptest=use_strict ; Don't test for strictness.
+
+=head1 DESCRIPTION
+
+Please use L<Dist::Zilla::Plugin::Test::Kwalitee> instead.
+
+This is an extension of L<Dist::Zilla::Plugin::InlineFiles>, providing the
+following file:
+
+ xt/release/kwalitee.t - a standard Test::Kwalitee test
+
+=cut
+
+before register_component => sub {
+ warn '!!! [KwaliteeTests] is deprecated, and will be removed in a future release. Please use [Test::Kwalitee] instead.';
+};
+
+__PACKAGE__->meta->make_immutable;
+no Moose;
+1;
View
36 t/deprecated.t
@@ -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', 'KwaliteeTests')
+ }
+ },
+ );
+ },
+ qr/^!!!.*deprecate/,
+ 'Got a deprecation warning'
+);
+
+$tzil->build;
+
+my @xtests = map $_->name =~ m{^xt/} ? $_->name : (), $tzil->files->flatten;
+ok(
+ (grep { $_ eq 'xt/release/kwalitee.t' } @xtests),
+ 'kwalitee.t exists'
+) or diag explain \@xtests;
+
+END { # Remove (empty) dir created by building the dists
+ require File::Path;
+ File::Path::rmtree('tmp');
+}
Please sign in to comment.
Something went wrong with that request. Please try again.