1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
#!perl
use strict;
use warnings;
eval {
require local::lib;
#local::lib->import();
};
use FindBin qw/$Script/;
package #
My;
use Moo;
with "MooX::File::ConfigDir";
package #
Mine;
use Moo;
sub _build_config_identifier { $FindBin::Script }
with "MooX::File::ConfigDir";
package #
main;
use Test::More;
my $mxfcd_ = My->new(config_identifier => $FindBin::Script);
my $_mxfcd = Mine->new();
my @supported_functions = (
qw(system_cfg_dir desktop_cfg_dir),
qw(core_cfg_dir site_cfg_dir vendor_cfg_dir),
qw(local_cfg_dir here_cfg_dir singleapp_cfg_dir),
qw(xdg_config_dirs xdg_config_home user_cfg_dir),
);
my $diag = Test::More->can('diag');
my $note = Test::More->can('note');
foreach my $fn (@supported_functions)
{
my $dirs_ = $mxfcd_->$fn;
my $_dirs = $_mxfcd->$fn;
my $report = is_deeply( $dirs_, $_dirs, "$fn" ) ? $note : $diag;
$report->( "$fn", explain($dirs_), explain($_dirs) );
}
done_testing();
|