Blob Blame History Raw
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