Apply upstream patch : Update Mysql2::Result spec for Ruby 3.1
This commit is contained in:
parent
1690d1e660
commit
8f26419007
38
rubygem-mysql2-0.5.3-update-Mysql2_Result-spec.patch
Normal file
38
rubygem-mysql2-0.5.3-update-Mysql2_Result-spec.patch
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
From 4dce466f3ff1c90099d3dc1bf610bfab840d3631 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jean Boussier <jean.boussier@gmail.com>
|
||||||
|
Date: Fri, 26 Nov 2021 13:17:05 +0100
|
||||||
|
Subject: [PATCH] Update Mysql2::Result spec for Ruby 3.1
|
||||||
|
|
||||||
|
Ruby 3.1 immediately raise a TypeError if you try to
|
||||||
|
instantiate a class that doesn't have an allocator,
|
||||||
|
which is what we want anyways.
|
||||||
|
---
|
||||||
|
spec/mysql2/result_spec.rb | 17 +++++++++++------
|
||||||
|
1 file changed, 11 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/spec/mysql2/result_spec.rb b/spec/mysql2/result_spec.rb
|
||||||
|
index 47a4a6de..2af6e609 100644
|
||||||
|
--- a/spec/mysql2/result_spec.rb
|
||||||
|
+++ b/spec/mysql2/result_spec.rb
|
||||||
|
@@ -6,11 +6,16 @@
|
||||||
|
end
|
||||||
|
|
||||||
|
it "should raise a TypeError exception when it doesn't wrap a result set" do
|
||||||
|
- r = Mysql2::Result.new
|
||||||
|
- expect { r.count }.to raise_error(TypeError)
|
||||||
|
- expect { r.fields }.to raise_error(TypeError)
|
||||||
|
- expect { r.size }.to raise_error(TypeError)
|
||||||
|
- expect { r.each }.to raise_error(TypeError)
|
||||||
|
+ if RUBY_VERSION >= "3.1"
|
||||||
|
+ expect { Mysql2::Result.new }.to raise_error(TypeError)
|
||||||
|
+ expect { Mysql2::Result.allocate }.to raise_error(TypeError)
|
||||||
|
+ else
|
||||||
|
+ r = Mysql2::Result.new
|
||||||
|
+ expect { r.count }.to raise_error(TypeError)
|
||||||
|
+ expect { r.fields }.to raise_error(TypeError)
|
||||||
|
+ expect { r.size }.to raise_error(TypeError)
|
||||||
|
+ expect { r.each }.to raise_error(TypeError)
|
||||||
|
+ end
|
||||||
|
end
|
||||||
|
|
||||||
|
it "should have included Enumerable" do
|
@ -14,6 +14,10 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
|||||||
# git clone --no-checkout https://github.com/brianmario/mysql2.git
|
# git clone --no-checkout https://github.com/brianmario/mysql2.git
|
||||||
# cd mysql2 && git archive -v -o mysql2-0.5.3-tests.txz 0.5.3 spec/
|
# cd mysql2 && git archive -v -o mysql2-0.5.3-tests.txz 0.5.3 spec/
|
||||||
Source1: %{gem_name}-%{version}-tests.txz
|
Source1: %{gem_name}-%{version}-tests.txz
|
||||||
|
# https://github.com/brianmario/mysql2/pull/1219
|
||||||
|
# https://github.com/brianmario/mysql2/commit/62003225f3b25c36c221f01f7905658848895410
|
||||||
|
# A bit modified
|
||||||
|
Patch1: rubygem-mysql2-0.5.3-update-Mysql2_Result-spec.patch
|
||||||
|
|
||||||
# Required in lib/mysql2.rb
|
# Required in lib/mysql2.rb
|
||||||
Requires: rubygem(bigdecimal)
|
Requires: rubygem(bigdecimal)
|
||||||
@ -49,7 +53,10 @@ Documentation for %{name}
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{gem_name}-%{version} -b 1
|
%setup -q -n %{gem_name}-%{version} -b 1
|
||||||
|
(
|
||||||
|
cd ../spec
|
||||||
|
%patch1 -p2
|
||||||
|
)
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# Create the gem as gem install only works on a gem file
|
# Create the gem as gem install only works on a gem file
|
||||||
@ -182,6 +189,7 @@ kill "$(cat "${MYSQL_TEST_PID_FILE}")"
|
|||||||
%changelog
|
%changelog
|
||||||
* Wed Jan 26 2022 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.5.3-10
|
* Wed Jan 26 2022 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.5.3-10
|
||||||
- F-36: rebuild against ruby31
|
- F-36: rebuild against ruby31
|
||||||
|
- Apply upstream patch : Update Mysql2::Result spec for Ruby 3.1
|
||||||
|
|
||||||
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.3-9
|
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.3-9
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||||
|
Loading…
Reference in New Issue
Block a user