Fix test assertion for mariadb-connector-c

https://github.com/brianmario/mysql2/issues/1240

also enhance .spec and .gitignore files.
This commit is contained in:
Pavel Valena 2022-02-17 12:00:42 +01:00
parent 8f26419007
commit deb21bb3fe
3 changed files with 35 additions and 18 deletions

12
.gitignore vendored
View File

@ -1,10 +1,2 @@
/mysql2-0.3.13.gem
/mysql2-0.3.15.gem
/mysql2-0.3.16.gem
/mysql2-0.4.0.gem
/mysql2-0.4.4.gem
/mysql2-0.4.8.gem
/mysql2-0.4.10.gem
/mysql2-0.5.2.gem
/mysql2-0.5.3-tests.txz
/mysql2-0.5.3.gem
/mysql2-*-tests.txz
/mysql2-*.gem

View File

@ -0,0 +1,22 @@
From cca57b97ad6d1b1b985376be110b89d2b487dea6 Mon Sep 17 00:00:00 2001
From: Aaron Patterson <tenderlove@ruby-lang.org>
Date: Tue, 30 Nov 2021 12:59:43 -0800
Subject: [PATCH] fix assertion on maria
downgrade psych
---
spec/mysql2/client_spec.rb | 2 +-
diff --git a/spec/mysql2/client_spec.rb b/spec/mysql2/client_spec.rb
index 1519e0f5d..41fb834bf 100644
--- a/spec/mysql2/client_spec.rb
+++ b/spec/mysql2/client_spec.rb
@@ -573,7 +573,7 @@ def run_gc
end
expect do
@client.query("SELECT SLEEP(1)")
- end.to raise_error(Mysql2::Error, /Lost connection to MySQL server/)
+ end.to raise_error(Mysql2::Error, /Lost connection/)
if RUBY_PLATFORM !~ /mingw|mswin/
expect do

View File

@ -6,7 +6,7 @@
Name: rubygem-%{gem_name}
Version: 0.5.3
Release: 10%{?dist}
Release: 11%{?dist}
Summary: A simple, fast Mysql library for Ruby, binding to libmysql
License: MIT
URL: https://github.com/brianmario/mysql2
@ -18,6 +18,9 @@ Source1: %{gem_name}-%{version}-tests.txz
# https://github.com/brianmario/mysql2/commit/62003225f3b25c36c221f01f7905658848895410
# A bit modified
Patch1: rubygem-mysql2-0.5.3-update-Mysql2_Result-spec.patch
# Fix test assertion for mariadb-connector-c
# https://github.com/brianmario/mysql2/commit/cca57b97ad6d1b1b985376be110b89d2b487dea6
Patch2: rubygem-mysql2-0.5.3-fix-assertion-mariadb-connector-c.patch
# Required in lib/mysql2.rb
Requires: rubygem(bigdecimal)
@ -53,17 +56,14 @@ Documentation for %{name}
%prep
%setup -q -n %{gem_name}-%{version} -b 1
(
cd ../spec
pushd %{_builddir}/spec
%patch1 -p2
)
%patch2 -p2
popd
%build
# Create the gem as gem install only works on a gem file
gem build ../%{gem_name}-%{version}.gemspec
# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
# by default, so that we can move it into the buildroot in %%install
%gem_install
@ -187,6 +187,9 @@ kill "$(cat "${MYSQL_TEST_PID_FILE}")"
%changelog
* Thu Feb 17 2022 Pavel Valena <pvalena@redhat.com> - 0.5.3-11
- Fix test assertion for mariadb-connector-c
* Wed Jan 26 2022 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.5.3-10
- F-36: rebuild against ruby31
- Apply upstream patch : Update Mysql2::Result spec for Ruby 3.1