use warnings tester with fewer dependencies, issues
[gitmo/MooseX-Getopt.git] / t / 112_configfile_constructor_arg.t
index 1798a65..4b83b07 100644 (file)
@@ -1,13 +1,18 @@
 use strict;
-use warnings;
-
-use Test::Requires
-    'MooseX::SimpleConfig'; # skip all if not installed
+use warnings FATAL => 'all';
 
 # respect the configfile value passed into the constructor.
 
-use Test::More tests => 2;
-use Path::Class;    # exports file, dir
+use Test::Requires 'MooseX::SimpleConfig';  # skip all if not installed
+use Test::More tests => 3;
+use Test::Warnings;
+use Path::Tiny 0.009;
+
+# avoid warning if all we have installed is YAML or YAML::Syck - the user will
+# see this eventually when he actually uses MooseX::SimpleConfig in his own
+# code
+use Config::Any::YAML;
+$Config::Any::YAML::NO_YAML_XS_WARNING = 1;
 
 {
     package Foo;
@@ -21,12 +26,12 @@ use Path::Class;    # exports file, dir
 }
 
 {
-    my $configfile = file(qw(t 112_configfile_constructor_arg.yml))->stringify;
+    my $configfile = path(qw(t 112_configfile_constructor_arg.yml))->stringify;
 
     my $obj = Foo->new_with_options(configfile => $configfile);
 
     is(
-        $obj->configfile,
+        path($obj->configfile),
         $configfile,
         'configfile value is used from the constructor',
     );