convert from Path::Class to Path::Tiny
[gitmo/MooseX-ConfigFromFile.git] / t / 06_path_tiny.t
1 use strict;
2 use warnings;
3
4 use Test::More tests => 5;
5 use Test::NoWarnings 1.04 ':early';
6 use Path::Tiny 'path';
7 use Path::Class 'file';
8
9 {
10     package Generic;
11     use Moose;
12     with 'MooseX::SimpleConfig';
13     sub get_config_from_file { }
14 }
15
16 {
17     my $obj = Generic->new(configfile => path('i/do/not_exist'));
18     is($obj->configfile, 'i/do/not_exist', 'stringification returns path');
19     isa_ok($obj->configfile, 'Path::Tiny');
20 }
21
22 {
23     my $obj = Generic->new(configfile => file('i/do/not_exist'));
24     is($obj->configfile, 'i/do/not_exist', 'stringification returns path');
25     isa_ok($obj->configfile, 'Path::Tiny');
26 }
27