diff options
author | Tatsuhiko Miyagawa <miyagawa@bulknews.net> | 2013-06-01 14:54:24 +0900 |
---|---|---|
committer | Tatsuhiko Miyagawa <miyagawa@bulknews.net> | 2013-06-01 14:54:24 +0900 |
commit | 5c8f94569d907247926648bb1480ff92fee966ff (patch) | |
tree | 59ffc6bac197114cdcef992980bcbb3303d51528 | |
parent | 5739372621f57e19b01cd0b0dbb47aeb89dabdac (diff) | |
download | carton-5c8f94569d907247926648bb1480ff92fee966ff.tar.gz |
Add convenience clean_local in xt
-rw-r--r-- | xt/CLI.pm | 8 | ||||
-rw-r--r-- | xt/cli/freeze.t | 4 | ||||
-rw-r--r-- | xt/cli/json_pp.t | 4 |
3 files changed, 9 insertions, 7 deletions
@@ -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"; |