public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Mamoru TASAKA <mtasaka@fedoraproject.org>
To: git-commits@fedoraproject.org
Subject: [rpms/rubygem-xmlrpc] rawhide: Backport upstream PR to fix testsuite for ruby4.1
Date: Fri, 13 Nov 2026 02:17:43 GMT	[thread overview]
Message-ID: <179453626330.1.11080024025331462201.rpms-rubygem-xmlrpc-b93305183598@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/rubygem-xmlrpc
Branch : rawhide
Commit : b933051835987f5e5d03696b48aceea9f548cd9d
Author : Mamoru TASAKA <mtasaka@fedoraproject.org>
Date   : 2026-11-13T00:04:02+09:00
Stats  : +78/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rubygem-xmlrpc/c/b933051835987f5e5d03696b48aceea9f548cd9d?branch=rawhide

Log:
Backport upstream PR to fix testsuite for ruby4.1

---
diff --git a/rubygem-xmlrpc.spec b/rubygem-xmlrpc.spec
index 73a781d..6419bf2 100644
--- a/rubygem-xmlrpc.spec
+++ b/rubygem-xmlrpc.spec
@@ -3,7 +3,7 @@
 
 Name: rubygem-%{gem_name}
 Version: 0.3.2
-Release: 14%{?dist}
+Release: 15%{?dist}
 Summary: XMLRPC is a lightweight protocol that enables remote procedure calls over HTTP
 # Automatically converted from old format: Ruby or BSD - review is highly recommended.
 License: Ruby OR LicenseRef-Callaway-BSD
@@ -16,6 +16,9 @@ Source1: xmlrpc-%{version}-tests.txz
 # https://github.com/ruby/xmlrpc/pull/54
 # Remove unneeded logger dep
 Patch0:  xmlrpc-pr54-remover-logger-dep.patch
+# https://github.com/ruby/xmlrpc/pull/72
+# Fix testsuite for ruby4.1
+Patch1:  xmlrpc-pr72-testsuite-ruby41.patch
 
 BuildRequires: ruby(release)
 BuildRequires: rubygems-devel
@@ -42,6 +45,7 @@ Documentation for %{name}.
 (
 cd %{_builddir}
 %patch -P0 -p1
+%patch -P1 -p1
 )
 
 %build
@@ -79,6 +83,9 @@ popd
 %{gem_instdir}/NEWS.md
 
 %changelog
+* Thu Nov 12 2026 Mamoru TASAKA <mtasaka@fedoraproject.org> - 0.3.2-15
+- Backport upstream PR to fix testsuite for ruby4.1
+
 * Fri Jul 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.2-14
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
 

diff --git a/xmlrpc-pr72-testsuite-ruby41.patch b/xmlrpc-pr72-testsuite-ruby41.patch
new file mode 100644
index 0000000..9a4e700
--- /dev/null
+++ b/xmlrpc-pr72-testsuite-ruby41.patch
@@ -0,0 +1,70 @@
+From e5a800224a5246c626cbf995bd55f84b2945ab07 Mon Sep 17 00:00:00 2001
+From: Sutou Kouhei <kou@clear-code.com>
+Date: Mon, 2 Nov 2026 17:46:35 +0900
+Subject: [PATCH] test: don't override `Fake::HTTP.new`
+
+GitHub: fix GH-70
+
+`Fake::HTTP.new` used `Class.method(:new).unbind.bind(self)` to bypass
+`Net::HTTP.new`. It fails with Ruby 4.1 because `Class.method(:new)` is
+a singleton method of `Class` now:
+
+```text
+TypeError: singleton method called for a different object
+```
+
+We don't need to bypass `Net::HTTP.new`. We can use the default
+`Net::HTTP#initialize` and set responses by an attribute writer instead.
+
+Reported by Mamoru TASAKA. Thanks!!!
+
+Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
+---
+ test/test_client.rb | 20 +++++++-------------
+ 1 file changed, 7 insertions(+), 13 deletions(-)
+
+diff --git a/test/test_client.rb b/test/test_client.rb
+index e33f213..c54aff0 100644
+--- a/test/test_client.rb
++++ b/test/test_client.rb
+@@ -11,17 +11,7 @@ module XMLRPC
+   class ClientTest < Test::Unit::TestCase
+     module Fake
+       class HTTP < Net::HTTP
+-        class << self
+-          def new(*args, &block)
+-            Class.method(:new).unbind.bind(self).call(*args, &block)
+-          end
+-        end
+-
+-        def initialize responses = {}
+-          super("127.0.0.1")
+-          @started = false
+-          @responses = responses
+-        end
++        attr_writer :responses
+ 
+         def started?
+           @started
+@@ -54,7 +44,7 @@ module XMLRPC
+ 
+         private
+         def net_http host, port, proxy_host, proxy_port
+-          HTTP.new
++          HTTP.new("127.0.0.1")
+         end
+       end
+ 
+@@ -350,7 +340,11 @@ module XMLRPC
+ 
+     def fake_client responses
+       Class.new(Fake::Client) {
+-        define_method(:net_http) { |*_| Fake::HTTP.new(responses) }
++        define_method(:net_http) do |*_|
++          http = Fake::HTTP.new("127.0.0.1")
++          http.responses = responses
++          http
++        end
+       }
+     end
+   end

                 reply	other threads:[~2026-11-13  2:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179453626330.1.11080024025331462201.rpms-rubygem-xmlrpc-b93305183598@fedoraproject.org \
    --to=mtasaka@fedoraproject.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox