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';
{
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;
}
extends 'App';
has '+configfile' => (
- default => File::Spec->canonpath('/notused/default'),
+ default => Path::Tiny::path('/notused/default')->stringify,
);
}
extends 'App';
has '+configfile' => (
- default => sub { return File::Spec->canonpath('/notused/default') },
+ default => sub { return Path::Tiny::path('/notused/default') },
);
}
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' );
}
}
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' );
}
}
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' );
}
{
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' );
}
}
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
}
{
- 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);