[carton] 241/472: Add convenience clean_local in xt
Lucas Kanashiro
kanashiro-guest at moszumanska.debian.org
Fri Jul 24 00:38:50 UTC 2015
This is an automated email from the git hooks/post-receive script.
kanashiro-guest pushed a commit to branch master
in repository carton.
commit 5c8f94569d907247926648bb1480ff92fee966ff
Author: Tatsuhiko Miyagawa <miyagawa at bulknews.net>
Date: Sat Jun 1 14:54:24 2013 +0900
Add convenience clean_local in xt
---
xt/CLI.pm | 8 +++++++-
xt/cli/freeze.t | 4 +---
xt/cli/json_pp.t | 4 +---
3 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/xt/CLI.pm b/xt/CLI.pm
index c72191a..62ab801 100644
--- a/xt/CLI.pm
+++ b/xt/CLI.pm
@@ -16,7 +16,8 @@ use parent qw(Carton::CLI);
$Carton::CLI::UseSystem = 1;
use Capture::Tiny qw(capture);
-use File::pushd;
+use File::pushd ();
+use File::Path ();
sub new {
my($class, %args) = @_;
@@ -61,5 +62,10 @@ sub system_error {
$self->{system_error};
}
+sub clean_local {
+ my $self = shift;
+ File::Path::rmtree("$self->{dir}/local", 1);
+}
+
1;
diff --git a/xt/cli/freeze.t b/xt/cli/freeze.t
index 3f99163..d9d701b 100644
--- a/xt/cli/freeze.t
+++ b/xt/cli/freeze.t
@@ -2,8 +2,6 @@ use strict;
use Test::More;
use xt::CLI;
-use File::Path qw(rmtree);
-
{
my $app = cli();
@@ -15,7 +13,7 @@ EOF
$app->run("list");
like $app->output, qr/Try-Tiny-0\.11/;
- rmtree($app->dir . "/local", 1);
+ $app->clean_local;
$app->run("install");
$app->run("list");
diff --git a/xt/cli/json_pp.t b/xt/cli/json_pp.t
index 246f07b..b704986 100644
--- a/xt/cli/json_pp.t
+++ b/xt/cli/json_pp.t
@@ -2,8 +2,6 @@ use strict;
use Test::More;
use xt::CLI;
-use File::Path qw(rmtree);
-
plan skip_all => "perl <= 5.14" if $] >= 5.015;
{
@@ -15,7 +13,7 @@ requires 'CPAN::Meta', '2.12';
EOF
$app->run("install");
- rmtree($app->dir . "/local", 1);
+ $app->clean_local;
TODO: {
local $TODO = "collect installs";
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/carton.git
More information about the Pkg-perl-cvs-commits
mailing list