Skip Menu |

This queue is for tickets about the Dist-Zilla-Plugins-CJM CPAN distribution.

Report information
The Basics
Id: 119960
Status: new
Priority: 0/
Queue: Dist-Zilla-Plugins-CJM

People
Owner: Nobody in particular
Requestors: ppisar [...] redhat.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 4.27
Fixed in: (no value)



Subject: Tests warn about use of deprecated Dist::Zilla::Path methods
If Dist-Zilla-6.008 is installed, tests warn about use of deprecated Dist::Zilla::Path methods: t/arcrel.t .............. 1/6 ->file called on a Dist::Zilla::Path object; this will cease to work in Dist::Zilla v7; downstream code should be updated to use Path::Tiny API, not Path: :Class at t/arcrel.t line 82. ->file called on a Dist::Zilla::Path object; this will cease to work in Dist::Zilla v7; downstream code should be updated to use Path::Tiny API, not Path::Class at t/arcrel.t line 85. t/arcrel.t .............. ok t/gitvercheck.t ......... ->subdir called on a Dist::Zilla::Path object; this will cease to work in Dist::Zilla v7; downstream code should be updated to use Path::Tiny API, not Path::C lass at t/gitvercheck.t line 99. t/gitvercheck.t ......... 1/18 ->subdir called on a Dist::Zilla::Path object; this will cease to work in Dist::Zilla v7; downstream code should be updated to use Path::Tiny API, not Pa th::Class at t/gitvercheck.t line 99. t/gitvercheck.t ......... 3/18 ->subdir called on a Dist::Zilla::Path object; this will cease to work in Dist::Zilla v7; downstream code should be updated to use Path::Tiny API, not Pa th::Class at t/gitvercheck.t line 99. ->subdir called on a Dist::Zilla::Path object; this will cease to work in Dist::Zilla v7; downstream code should be updated to use Path::Tiny API, not Path::Class at t/gitvercheck.t li ne 99. ->subdir called on a Dist::Zilla::Path object; this will cease to work in Dist::Zilla v7; downstream code should be updated to use Path::Tiny API, not Path::Class at t/gitvercheck.t li ne 99. ->subdir called on a Dist::Zilla::Path object; this will cease to work in Dist::Zilla v7; downstream code should be updated to use Path::Tiny API, not Path::Class at t/gitvercheck.t line 99. t/gitvercheck.t ......... 11/18 ->subdir called on a Dist::Zilla::Path object; this will cease to work in Dist::Zilla v7; downstream code should be updated to use Path::Tiny API, not Path::Class at t/gitvercheck.t line 99. ->subdir called on a Dist::Zilla::Path object; this will cease to work in Dist::Zilla v7; downstream code should be updated to use Path::Tiny API, not Path::Class at t/gitvercheck.t line 99. ->subdir called on a Dist::Zilla::Path object; this will cease to work in Dist::Zilla v7; downstream code should be updated to use Path::Tiny API, not Path::Class at t/gitvercheck.t line 99.
From: ppisar [...] redhat.com
Dne Út 24.led.2017 12:22:36, ppisar napsal(a): Show quoted text
> If Dist-Zilla-6.008 is installed, tests warn about use of deprecated > Dist::Zilla::Path methods: >
Attached patch fixes it.
Subject: 0001-Migrate-tests-from-depreated-methods-to-Dist-Zilla-P.patch
From 1535d7dab1df2c9e9f62a685d0ed643bda16a6cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Tue, 24 Jan 2017 18:27:15 +0100 Subject: [PATCH] Migrate tests from depreated methods to Dist::Zilla::Path::path() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dist::Zilla::Path 6.008 warns that file() and subdir() methods are depracated: t/arcrel.t .............. 2/6 ->file called on a Dist::Zilla::Path object; this will cease to work in Dist::Zilla v7; downstream code should be updated to use Path::Tiny API, not Path::Class at t/arcrel.t line 82. This patch uses Dist::Zilla::Path::path() instead. CPAN RT#119960 Signed-off-by: Petr Písař <ppisar@redhat.com> --- t/arcrel.t | 4 ++-- t/gitvercheck.t | 2 +- t/recommendedprereqs.t | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/t/arcrel.t b/t/arcrel.t index 4320f72..9efef9b 100644 --- a/t/arcrel.t +++ b/t/arcrel.t @@ -79,10 +79,10 @@ sub new_tzil $tzil->release; - my $tarball = $tzil->root->file('releases/DZT-Sample-0.001.tar.gz'); + my $tarball = $tzil->root->path('releases/DZT-Sample-0.001.tar.gz'); ok(-e $tarball, 'archived tarball'); is($tarball->stat->mode & 0777, 0444, 'tarball is read-only'); - ok((not -e $tzil->root->file('DZT-Sample-0.001.tar.gz')), + ok((not -e $tzil->root->path('DZT-Sample-0.001.tar.gz')), 'tarball was moved'); } diff --git a/t/gitvercheck.t b/t/gitvercheck.t index b4a312f..5084c35 100644 --- a/t/gitvercheck.t +++ b/t/gitvercheck.t @@ -96,7 +96,7 @@ sub new_tzil # Something about the copy dzil makes seems to confuse git into # thinking files are modified when they aren't. # Run "git reset --mixed" in the source directory to unconfuse it: - Git::Wrapper->new( $tzil->tempdir->subdir("source")->stringify ) + Git::Wrapper->new( $tzil->tempdir->path("source")->stringify ) ->reset('--mixed'); $tzil; diff --git a/t/recommendedprereqs.t b/t/recommendedprereqs.t index aed0764..4b1bf4f 100644 --- a/t/recommendedprereqs.t +++ b/t/recommendedprereqs.t @@ -21,7 +21,7 @@ my $tzil = Builder->from_config( $tzil->build; -my $meta = Parse::CPAN::Meta->load_file($tzil->tempdir->file('build/META.yml')); +my $meta = Parse::CPAN::Meta->load_file($tzil->tempdir->path('build/META.yml')); my $ver = version->new($meta->{'meta-spec'}{version}); diag "CPAN::Meta::Spec = $ver"; -- 2.7.4
From: ppisar [...] redhat.com
Dne Út 24.led.2017 12:33:51, ppisar napsal(a): Show quoted text
> Dne Út 24.led.2017 12:22:36, ppisar napsal(a):
> > If Dist-Zilla-6.008 is installed, tests warn about use of deprecated > > Dist::Zilla::Path methods: > >
> Attached patch fixes it.
I discovered the patch breaks tests if run against Dist-Zilla-5.047 because the needed Dist::Zilla::Path::path() method is available since Dist-Zilla 6. Either one has to adjust minimal Dist-Zilla dependency version or put a run-time decision into the tests.