From: Karen Etheridge Date: Sat, 2 Feb 2013 19:47:27 +0000 (-0800) Subject: Path::Class -> Path::Tiny X-Git-Tag: v0.52~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e202fd48ff22367bb28fd3aef438a301aa3e87a9;p=gitmo%2FMooseX-Getopt.git Path::Class -> Path::Tiny --- diff --git a/Changes b/Changes index 581f89d..d0833d7 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Revision history for Perl extension MooseX-Getopt {{$NEXT}} + - tests converted from using Path::Class to Path::Tiny 0.51 2013-01-27 09:38:11 PST-0800 - missing test prereqs now declared (thanks for the automated reports, David diff --git a/dist.ini b/dist.ini index 4789397..48a43a1 100644 --- a/dist.ini +++ b/dist.ini @@ -35,11 +35,10 @@ Test::Warn = 0.21 Test::More = 0 Test::Requires = 0.05 Test::Trap = 0 -Path::Class = 0 +Path::Tiny = 0 Test::NoWarnings = 1.04 Test::Moose = 0 Config::Any::YAML = 0 -File::Spec = 0 Scalar::Util = 0 [Prereqs / TestRecommends] diff --git a/t/008_configfromfile.t b/t/008_configfromfile.t index 9a490e5..9373d0f 100644 --- a/t/008_configfromfile.t +++ b/t/008_configfromfile.t @@ -1,10 +1,10 @@ use strict; use warnings; -use Test::Requires 'MooseX::ConfigFromFile'; # skip all if not installed +use Test::Requires 'MooseX::ConfigFromFile' => '0.06'; # skip all if not installed use Test::More tests => 38; use Test::Fatal; -use File::Spec; +use Path::Tiny; use Test::NoWarnings 1.04 ':early'; { @@ -47,7 +47,7 @@ use Test::NoWarnings 1.04 ':early'; optional_from_config => 'from_config_2', ); - my $cpath = File::Spec->canonpath('/notused/default'); + my $cpath = Path::Tiny::path('/notused/default'); if ( $file ne $cpath ) { $config{config_from_override} = 1; } @@ -63,7 +63,7 @@ use Test::NoWarnings 1.04 ':early'; extends 'App'; has '+configfile' => ( - default => File::Spec->canonpath('/notused/default'), + default => Path::Tiny::path('/notused/default')->stringify, ); } @@ -74,7 +74,7 @@ use Test::NoWarnings 1.04 ':early'; extends 'App'; has '+configfile' => ( - default => sub { return File::Spec->canonpath('/notused/default') }, + default => sub { return Path::Tiny::path('/notused/default') }, ); } @@ -95,7 +95,7 @@ use Test::NoWarnings 1.04 ':early'; ok( !$app->config_from_override, '... config_from_override false as expected' ); - is( $app->configfile, File::Spec->canonpath('/notused/default'), + is( $app->configfile, path('/notused/default'), '... configfile is /notused/default as expected' ); } } @@ -112,7 +112,7 @@ use Test::NoWarnings 1.04 ':early'; ok( !$app->config_from_override, '... config_from_override false as expected' ); - is( $app->configfile, File::Spec->canonpath('/notused/default'), + is( $app->configfile, path('/notused/default'), '... configfile is /notused/default as expected' ); } } @@ -135,7 +135,7 @@ use Test::NoWarnings 1.04 ':early'; ok( $app->config_from_override, '... config_from_override true as expected' ); - is( $app->configfile, File::Spec->canonpath('/notused'), + is( $app->configfile, path('/notused'), '... configfile is /notused as expected' ); } { @@ -146,7 +146,7 @@ use Test::NoWarnings 1.04 ':early'; ok( $app->config_from_override, '... config_from_override true as expected' ); - is( $app->configfile, File::Spec->canonpath('/notused'), + is( $app->configfile, path('/notused'), '... configfile is /notused as expected' ); } } diff --git a/t/112_configfile_constructor_arg.t b/t/112_configfile_constructor_arg.t index 68455b9..2435cfc 100644 --- a/t/112_configfile_constructor_arg.t +++ b/t/112_configfile_constructor_arg.t @@ -6,7 +6,7 @@ use warnings; use Test::Requires 'MooseX::SimpleConfig'; # skip all if not installed use Test::More tests => 3; use Test::NoWarnings 1.04 ':early'; -use Path::Class; # exports file, dir +use Path::Tiny; # avoid warning if all we have installed is YAML or YAML::Syck - the user will # see this eventually when he actually uses MooseX::SimpleConfig in his own @@ -26,7 +26,7 @@ $Config::Any::YAML::NO_YAML_XS_WARNING = 1; } { - my $configfile = file(qw(t 112_configfile_constructor_arg.yml))->stringify; + my $configfile = path(qw(t 112_configfile_constructor_arg.yml))->stringify; my $obj = Foo->new_with_options(configfile => $configfile);