reuse common testing code in a base class
[gitmo/MooseX-ConfigFromFile.git] / t / 06_path_tiny.t
CommitLineData
0b75e547 1use strict;
bd567467 2use warnings FATAL => 'all';
0b75e547 3
0864e862 4use Test::Requires 'MooseX::SimpleConfig'; # skip all if not reuqired
0b75e547 5use Test::More tests => 5;
6use Test::NoWarnings 1.04 ':early';
7use Path::Tiny 'path';
8use 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