Fix compatibility with GLD 0.103 (GH#12, GH#13)
This commit is contained in:
parent
055f84f8d5
commit
87383fdabc
|
@ -0,0 +1,78 @@
|
|||
commit 91da15eed08ede5d7486ccc3eec9b70ae493d627
|
||||
Author: Paul Howarth <paul@city-fan.org>
|
||||
Date: Tue Aug 21 16:47:12 2018 +0100
|
||||
|
||||
Cope with GLD output changes in version 0.103
|
||||
|
||||
The output text format of Getopt::Long::Descriptive changed yet again
|
||||
at version 0.103 and broke some of the tests. This change fixes the
|
||||
tests without breaking compatibility with older versions of
|
||||
Getopt::Long::Descriptive.
|
||||
|
||||
diff --git a/t/104_override_usage.t b/t/104_override_usage.t
|
||||
index bdee6c6..bc45029 100644
|
||||
--- a/t/104_override_usage.t
|
||||
+++ b/t/104_override_usage.t
|
||||
@@ -55,9 +55,15 @@ use Test::Exception;
|
||||
\t--foo INT A foo
|
||||
}
|
||||
:
|
||||
+ $Getopt::Long::Descriptive::VERSION < 0.103 ?
|
||||
qq{usage: 104_override_usage.t [-?] [long options...]
|
||||
\t-? --usage --help Prints this usage information.
|
||||
\t--foo INT A foo
|
||||
+}
|
||||
+ :
|
||||
+ qq{usage: 104_override_usage.t [-?] [long options...]
|
||||
+\t-? --[no-]usage --[no-]help Prints this usage information.
|
||||
+\t--foo INT A foo
|
||||
}
|
||||
|
||||
];
|
||||
diff --git a/t/107_no_auto_help.t b/t/107_no_auto_help.t
|
||||
index 1091fd2..27f87f5 100644
|
||||
--- a/t/107_no_auto_help.t
|
||||
+++ b/t/107_no_auto_help.t
|
||||
@@ -60,7 +60,7 @@ END {
|
||||
warning_like {
|
||||
throws_ok { Class->new_with_options }
|
||||
#usage: 107_no_auto_help.t [-?] [long options...]
|
||||
- qr/^usage: [\d\w]+\Q.t [-?] [long options...]\E.\s+\Q-? --usage --help\E\s+\QPrints this usage information.\E.\s+--configfile/ms,
|
||||
+ qr/^usage: [\d\w]+\Q.t [-?] [long options...]\E.\s+\Q-? --\E(\[no-\])?usage --(\[no-\])?\Qhelp\E\s+\QPrints this usage information.\E.\s+--configfile/ms,
|
||||
'usage information looks good';
|
||||
}
|
||||
qr/^Specified configfile \'this_value_unimportant\' does not exist, is empty, or is not readable$/,
|
||||
diff --git a/t/109_help_flag.t b/t/109_help_flag.t
|
||||
index adc6e0c..8c658e2 100644
|
||||
--- a/t/109_help_flag.t
|
||||
+++ b/t/109_help_flag.t
|
||||
@@ -40,7 +40,7 @@ foreach my $args ( ['--help'], ['--usage'], ['--?'], ['-?'] )
|
||||
local @ARGV = @$args;
|
||||
|
||||
throws_ok { MyClass->new_with_options() }
|
||||
- qr/^usage: (?:[\d\w]+)\Q.t [-?] [long options...]\E.^\t\Q-? --usage --help\E\s+\QPrints this usage information.\E$/ms,
|
||||
+ qr/^usage: (?:[\d\w]+)\Q.t [-?] [long options...]\E.^\t\Q-? --\E(\[no-\])?usage --(\[no-\])?help\s+\QPrints this usage information.\E$/ms,
|
||||
'Help request detected; usage information properly printed';
|
||||
}
|
||||
|
||||
diff --git a/t/110_sort_usage_by_attr_order.t b/t/110_sort_usage_by_attr_order.t
|
||||
index 3eb4a49..e7dd177 100644
|
||||
--- a/t/110_sort_usage_by_attr_order.t
|
||||
+++ b/t/110_sort_usage_by_attr_order.t
|
||||
@@ -54,6 +54,16 @@ usage: 110_sort_usage_by_attr_order.t [-?] [long options...]
|
||||
--baz STR Documentation for "baz"
|
||||
USAGE
|
||||
}
|
||||
+if ( $Getopt::Long::Descriptive::VERSION >= 0.103 )
|
||||
+{
|
||||
+$expected = <<'USAGE';
|
||||
+usage: 110_sort_usage_by_attr_order.t [-?] [long options...]
|
||||
+ -? --[no-]usage --[no-]help Prints this usage information.
|
||||
+ --foo STR Documentation for "foo"
|
||||
+ --bar STR Documentation for "bar"
|
||||
+ --baz STR Documentation for "baz"
|
||||
+USAGE
|
||||
+}
|
||||
$expected =~ s/^[ ]{4}/\t/xmsg;
|
||||
is($obj->usage->text, $expected, 'Usage text has nicely sorted options');
|
||||
|
|
@ -1,14 +1,15 @@
|
|||
Name: perl-MouseX-Getopt
|
||||
Summary: Mouse role for processing command line options
|
||||
Version: 0.37
|
||||
Release: 9%{?dist}
|
||||
Release: 10%{?dist}
|
||||
License: GPL+ or Artistic
|
||||
URL: https://metacpan.org/release/MouseX-Getopt
|
||||
Source0: https://cpan.metacpan.org/authors/id/G/GF/GFUJI/MouseX-Getopt-%{version}.tar.gz
|
||||
Patch0: MouseX-Getopt-0.37-gld103.patch
|
||||
BuildArch: noarch
|
||||
# Module Build
|
||||
BuildRequires: perl-interpreter
|
||||
BuildRequires: perl-generators
|
||||
BuildRequires: perl-interpreter
|
||||
BuildRequires: perl(Module::Build::Tiny) >= 0.035
|
||||
BuildRequires: perl(strict)
|
||||
BuildRequires: perl(warnings)
|
||||
|
@ -48,6 +49,9 @@ objects using parameters passed in from the command line.
|
|||
%prep
|
||||
%setup -q -n MouseX-Getopt-%{version}
|
||||
|
||||
# Fix compatibility with GLD 0.103 (GH#12, GH#13)
|
||||
%patch0 -p1
|
||||
|
||||
%build
|
||||
perl Build.PL --installdirs=vendor
|
||||
./Build
|
||||
|
@ -59,7 +63,7 @@ perl Build.PL --installdirs=vendor
|
|||
./Build test
|
||||
|
||||
%files
|
||||
# Note: malformed LICENSE file in 0.35 .. 0.36 not shipped
|
||||
# Note: malformed LICENSE file in 0.35 .. 0.37 not shipped
|
||||
# https://github.com/gfx/mousex-getopt/issues/2
|
||||
%doc Changes README.md
|
||||
%{perl_vendorlib}/MouseX/
|
||||
|
@ -75,6 +79,9 @@ perl Build.PL --installdirs=vendor
|
|||
%{_mandir}/man3/MouseX::Getopt::Strict.3*
|
||||
|
||||
%changelog
|
||||
* Tue Aug 21 2018 Paul Howarth <paul@city-fan.org> - 0.37-10
|
||||
- Fix compatibility with GLD 0.103 (GH#12, GH#13)
|
||||
|
||||
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.37-9
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
|
|
Loading…
Reference in New Issue