From e9fc685088f86f62aaf0c77ca67a37cf67664a8b Mon Sep 17 00:00:00 2001 From: lyn1001 Date: Wed, 29 Jun 2022 18:00:38 +0800 Subject: [PATCH] Fix build failed with rubygem-rspec-mocks --- ...Fix-rspec-mocks-3.10.2-compatibility.patch | 43 +++++++++++++++++++ rubygem-thor.spec | 10 ++++- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 rubygem-thor-1.1.0-Fix-rspec-mocks-3.10.2-compatibility.patch diff --git a/rubygem-thor-1.1.0-Fix-rspec-mocks-3.10.2-compatibility.patch b/rubygem-thor-1.1.0-Fix-rspec-mocks-3.10.2-compatibility.patch new file mode 100644 index 0000000..6f42db6 --- /dev/null +++ b/rubygem-thor-1.1.0-Fix-rspec-mocks-3.10.2-compatibility.patch @@ -0,0 +1,43 @@ +From 3da3b44afdf2fa0bd618b87c5d862e9def1d5f4f Mon Sep 17 00:00:00 2001 +From: Tim Diggins +Date: Fri, 4 Mar 2022 11:25:44 +0000 +Subject: [PATCH] First fix CI so it's green (see #780, #781) + +fix options spec. + +allow line_editor spec to be run independently + +running `rspec spec/line_editor_spec.rb` generated a double error +when it tries to re require "readline" + +fix expectations for ruby 3 treatment of hash arg + +try coveralls_reborn to fix ssl errors. + +Note that we could also use the coveralls action as recommended +in https://github.com/tagliala/coveralls-ruby-reborn +but it seems like a github token is needed, which makes +it more complex for contributors + +This does mean dropping coveralls for EOLed rubies but +do we really need to post to coveralls on each test run? +Wouldn't one test run be enough? +--- + spec/parser/options_spec.rb | 4 +++- + 1 file changed, 3 insertions(+), 1 deletions(-) + +diff --git a/spec/parser/options_spec.rb b/spec/parser/options_spec.rb +index b1e50fbf..5caf9f67 100644 +--- a/spec/parser/options_spec.rb ++++ b/spec/parser/options_spec.rb +@@ -116,7 +116,9 @@ def remaining + expected = "Unknown switches \"--baz\"" + expected << "\nDid you mean? \"--bar\"" if Thor::Correctable + +- expect { check_unknown! }.to raise_error(Thor::UnknownArgumentError, expected) ++ expect { check_unknown! }.to raise_error(Thor::UnknownArgumentError) do |error| ++ expect(error.to_s).to eq(expected) ++ end + end + + it "skips leading non-switches" do diff --git a/rubygem-thor.spec b/rubygem-thor.spec index 5367664..fdc0ad8 100644 --- a/rubygem-thor.spec +++ b/rubygem-thor.spec @@ -2,12 +2,13 @@ Name: rubygem-%{gem_name} Version: 1.1.0 -Release: 2 +Release: 3 Summary: Thor is a toolkit for building powerful command-line interfaces License: MIT URL: http://whatisthor.com/ Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem Source1: %{gem_name}-%{version}-spec.txz +Patch0: rubygem-thor-1.1.0-Fix-rspec-mocks-3.10.2-compatibility.patch Requires: rubygem(io-console) BuildRequires: ruby(release) @@ -36,6 +37,10 @@ Documentation for %{name}. %prep %setup -q -n %{gem_name}-%{version} -b1 +pushd %{_builddir} +%patch0 -p1 +popd + %build gem build ../%{gem_name}-%{version}.gemspec %gem_install @@ -80,6 +85,9 @@ popd %{gem_instdir}/thor.gemspec %changelog +* Wed Jun 29 2022 liyanan - 1.1.0-3 +- Fix build failed with rubygem-rspec-mocks + * Wed Mar 30 2022 ouyangminxiang - 1.1.0-2 - add BuildRequires: rubygem-bigdecimal rubygem-io-console rubygem-openssl rubygem-psych to resolve koji build error during check