Commit | Line | Data |
0b75e547 |
1 | use strict; |
2 | use warnings; |
3 | |
0864e862 |
4 | use Test::Requires 'MooseX::SimpleConfig'; # skip all if not reuqired |
0b75e547 |
5 | use Test::More tests => 5; |
6 | use Test::NoWarnings 1.04 ':early'; |
7 | use Path::Tiny 'path'; |
8 | use Path::Class 'file'; |
9 | |
10 | { |
11 | package Generic; |
12 | use Moose; |
13 | with 'MooseX::SimpleConfig'; |
14 | sub get_config_from_file { } |
15 | } |
16 | |
17 | { |
18 | my $obj = Generic->new(configfile => path('i/do/not_exist')); |
19 | is($obj->configfile, 'i/do/not_exist', 'stringification returns path'); |
20 | isa_ok($obj->configfile, 'Path::Tiny'); |
21 | } |
22 | |
23 | { |
24 | my $obj = Generic->new(configfile => file('i/do/not_exist')); |
25 | is($obj->configfile, 'i/do/not_exist', 'stringification returns path'); |
26 | isa_ok($obj->configfile, 'Path::Tiny'); |
27 | } |
28 | |