diff --git a/Add-matrix-as-a-dependency-for-Ruby-3.1-compatibility.patch b/Add-matrix-as-a-dependency-for-Ruby-3.1-compatibility.patch new file mode 100644 index 0000000..d01ecee --- /dev/null +++ b/Add-matrix-as-a-dependency-for-Ruby-3.1-compatibility.patch @@ -0,0 +1,10 @@ +--- a/capybara-3.34.0.gemspec 2023-01-05 14:47:52.021052878 +0800 ++++ b/capybara-3.34.0.gemspec 2023-01-05 14:56:30.781466150 +0800 +@@ -26,6 +26,7 @@ + + if s.respond_to? :add_runtime_dependency then + s.add_runtime_dependency(%q.freeze, [">= 0"]) ++ s.add_runtime_dependency(%q.freeze, [">= 0"]) + s.add_runtime_dependency(%q.freeze, [">= 0.1.3"]) + s.add_runtime_dependency(%q.freeze, ["~> 1.8"]) + s.add_runtime_dependency(%q.freeze, [">= 1.6.0"]) diff --git a/Use-Psych-safe-load-in-tests.patch b/Use-Psych-safe-load-in-tests.patch new file mode 100644 index 0000000..4608ea2 --- /dev/null +++ b/Use-Psych-safe-load-in-tests.patch @@ -0,0 +1,26 @@ +From c5151907f29a101912b1f419aff25a1db02c7978 Mon Sep 17 00:00:00 2001 +From: Thomas Walpole +Date: Fri, 28 May 2021 17:38:46 -0700 +Subject: [PATCH 1/2] Use Psych safe load in tests + +--- + lib/capybara/spec/spec_helper.rb | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/lib/capybara/spec/spec_helper.rb b/lib/capybara/spec/spec_helper.rb +index 7a3eb2ea49..c471afc26a 100644 +--- a/lib/capybara/spec/spec_helper.rb ++++ b/lib/capybara/spec/spec_helper.rb +@@ -117,8 +117,9 @@ def quietly(&block) + + def extract_results(session) + expect(session).to have_xpath("//pre[@id='results']") +- # YAML.load Nokogiri::HTML(session.body).xpath("//pre[@id='results']").first.inner_html.lstrip +- YAML.load Capybara::HTML(session.body).xpath("//pre[@id='results']").first.inner_html.lstrip ++ perms = [(::Sinatra::IndifferentHash if defined? ::Sinatra::IndifferentHash)].compact ++ results = Capybara::HTML(session.body).xpath("//pre[@id='results']").first.inner_html.lstrip ++ YAML.safe_load results, permitted_classes: perms + end + + def be_an_invalid_element_error(session) + diff --git a/rubygem-capybara.spec b/rubygem-capybara.spec index a36bd5e..0b2c2d6 100644 --- a/rubygem-capybara.spec +++ b/rubygem-capybara.spec @@ -1,7 +1,7 @@ %global gem_name capybara Name: rubygem-%{gem_name} Version: 3.34.0 -Release: 1 +Release: 2 Summary: Capybara aims to simplify the process of integration testing Rack applications License: MIT URL: https://github.com/teamcapybara/capybara @@ -9,10 +9,13 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem # git clone https://github.com/teamcapybara/capybara.git --no-checkout # cd capybara && git archive -v -o capybara-3.34.0-tests.txz 3.34.0 features/ Source1: %{gem_name}-%{version}-tests.txz +#https://github.com/teamcapybara/capybara/pull/2471 +Patch0001: Use-Psych-safe-load-in-tests.patch +Patch0002: Add-matrix-as-a-dependency-for-Ruby-3.1-compatibility.patch BuildRequires: ruby(release) rubygems-devel ruby rubygem(selenium-webdriver) rubygem(sinatra) BuildRequires: rubygem(rspec) rubygem(launchy) rubygem(minitest) rubygem(puma) BuildRequires: rubygem(nokogiri) rubygem(xpath) rubygem(rack-test) rubygem(mini_mime) -BuildRequires: rubygem(cucumber) rubygem(regexp_parser) +BuildRequires: rubygem(cucumber) rubygem(regexp_parser) rubygem(matrix) BuildArch: noarch %description Capybara is an integration testing tool for rack based web applications. It @@ -30,6 +33,11 @@ Documentation for %{name}. %gemspec_remove_dep -g regexp_parser ['~>1.5'] %gemspec_add_dep -g regexp_parser ['>=1.5', '<3.0'] +%patch0001 -p1 +pushd %_builddir +%patch0002 -p1 +popd + %build gem build ../%{gem_name}-%{version}.gemspec %gem_install @@ -69,6 +77,9 @@ popd %{gem_instdir}/spec %changelog +* Thu Jan 5 2023 liyanan - 3.34.0-2 +- fix build error with ruby 3.1 + * Tue Mar 29 2022 liyanan - 3.34.0-1 - update to 3.34.0