convert from Path::Class to Path::Tiny
[gitmo/MooseX-ConfigFromFile.git] / t / 06_path_tiny.t
diff --git a/t/06_path_tiny.t b/t/06_path_tiny.t
new file mode 100644 (file)
index 0000000..24c45ae
--- /dev/null
@@ -0,0 +1,27 @@
+use strict;
+use warnings;
+
+use Test::More tests => 5;
+use Test::NoWarnings 1.04 ':early';
+use Path::Tiny 'path';
+use Path::Class 'file';
+
+{
+    package Generic;
+    use Moose;
+    with 'MooseX::SimpleConfig';
+    sub get_config_from_file { }
+}
+
+{
+    my $obj = Generic->new(configfile => path('i/do/not_exist'));
+    is($obj->configfile, 'i/do/not_exist', 'stringification returns path');
+    isa_ok($obj->configfile, 'Path::Tiny');
+}
+
+{
+    my $obj = Generic->new(configfile => file('i/do/not_exist'));
+    is($obj->configfile, 'i/do/not_exist', 'stringification returns path');
+    isa_ok($obj->configfile, 'Path::Tiny');
+}
+