X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F008_configfromfile.t;h=9a490e5336ade17b9e6e4d9bd203f1cc7330964a;hb=44f514c7b7f403894b44d3b8ce7da3254cd40928;hp=1a1d847a62650b482424b47aeb4af7e46a124bed;hpb=aabf4179f74c8607d8c9de5a1da07a5f2cb48b3b;p=gitmo%2FMooseX-Getopt.git diff --git a/t/008_configfromfile.t b/t/008_configfromfile.t index 1a1d847..9a490e5 100644 --- a/t/008_configfromfile.t +++ b/t/008_configfromfile.t @@ -1,15 +1,11 @@ -#!/usr/bin/env perl - use strict; use warnings; -use Test::More tests => 37; +use Test::Requires 'MooseX::ConfigFromFile'; # skip all if not installed +use Test::More tests => 38; use Test::Fatal; use File::Spec; - -use Test::Requires 0.05 { - 'MooseX::ConfigFromFile' => 0.01, # skip all if not installed -}; +use Test::NoWarnings 1.04 ':early'; { package App; @@ -86,7 +82,10 @@ use Test::Requires 0.05 { { local @ARGV = qw( --required_from_argv 1 ); - like exception { App->new_with_options }, qr/Required option missing: required_from_config/; + like exception { App->new_with_options }, + ($Getopt::Long::Descriptive::VERSION >= 0.091 + ? qr/Mandatory parameter 'required_from_config' missing/ + : qr/Required option missing: required_from_config/); { my $app = App::DefaultConfigFile->new_with_options; @@ -155,7 +154,10 @@ use Test::Requires 0.05 { # Required arg not supplied from cmdline { local @ARGV = qw( --configfile /notused ); - like exception { App->new_with_options }, qr/Required option missing: required_from_argv/; + like exception { App->new_with_options }, + ($Getopt::Long::Descriptive::VERSION >= 0.091 + ? qr/Mandatory parameter 'required_from_argv' missing/ + : qr/Required option missing: required_from_argv/); } # Config file value overriden from cmdline