From 48056bf83cbedd863a4d1734e030497dc7b76fc8 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Fri, 2 Dec 2022 11:27:56 +0900 Subject: [PATCH 01/29] Backport upstream reviewing patch for ruby32 ruby2_keywords treatment change --- ...2.0-fixup-argument-forwarding-ruby32.patch | 22 +++++++++++++++++++ rubygem-rspec-mocks.spec | 9 +++++++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 rubygem-rspec-mocks-3.12.0-fixup-argument-forwarding-ruby32.patch diff --git a/rubygem-rspec-mocks-3.12.0-fixup-argument-forwarding-ruby32.patch b/rubygem-rspec-mocks-3.12.0-fixup-argument-forwarding-ruby32.patch new file mode 100644 index 0000000..6283d02 --- /dev/null +++ b/rubygem-rspec-mocks-3.12.0-fixup-argument-forwarding-ruby32.patch @@ -0,0 +1,22 @@ +From c1840fcf4a08a2e54aabb18df454544f950f679e Mon Sep 17 00:00:00 2001 +From: ojab +Date: Wed, 16 Nov 2022 22:56:12 +0000 +Subject: [PATCH] Fixup argument forwarding on ruby-3.2 + +Fixes #1495 +--- + lib/rspec/mocks/verifying_proxy.rb | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/rspec/mocks/verifying_proxy.rb b/lib/rspec/mocks/verifying_proxy.rb +index b39871c87..1d8d207dc 100644 +--- a/lib/rspec/mocks/verifying_proxy.rb ++++ b/lib/rspec/mocks/verifying_proxy.rb +@@ -160,6 +160,7 @@ def proxy_method_invoked(obj, *args, &block) + validate_arguments!(args) + super + end ++ ruby2_keywords :proxy_method_invoked if respond_to?(:ruby2_keywords, true) + + def validate_arguments!(actual_args) + @method_reference.with_signature do |signature| diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index d43479d..83be55a 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -3,7 +3,7 @@ %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} -%global fedorarel 2 +%global fedorarel 3 %global gem_name rspec-mocks @@ -27,6 +27,9 @@ Source2: rspec-related-create-full-tarball.sh Patch1: rubygem-rspec-mocks-3.12.0-display_keyword_hashes.patch # ... and related to the above, and commit 66250dc1819f9435e5f584064067e7f05a9afe72 Patch2: rubygem-rspec-mocks-3.12.0-display_keyword_hashes-additional.patch +# https://github.com/rspec/rspec-mocks/pull/1502 +# Fixup argument forwarding on ruby-3.2 +Patch3: rubygem-rspec-mocks-3.12.0-fixup-argument-forwarding-ruby32.patch #BuildRequires: ruby(release) BuildRequires: rubygems-devel @@ -64,6 +67,7 @@ gem unpack %{SOURCE0} %patch1 -p1 -R %patch2 -p1 -R %endif +%patch3 -p1 # Cucumber 7 syntax change sed -i cucumber.yml -e "s|~@wip|not @wip|" @@ -109,6 +113,9 @@ cucumber %{gem_docdir} %changelog +* Fri Dec 2 2022 Mamoru TASAKA - 3.12.0-3 +- Backport upstream reviewing patch for ruby32 ruby2_keywords treatment change + * Thu Nov 3 2022 Mamoru TASAKA - 3.12.0-2 - On Fedora 37, remove "Display keyword hashes" feature for now (On Fedora 38, this is effective) From 7643aa8e8d780d9fd35ed48dfc4ecf7814cd75ea Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 20 Jan 2023 21:04:53 +0000 Subject: [PATCH 02/29] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- rubygem-rspec-mocks.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index 83be55a..78c3757 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -14,7 +14,7 @@ Summary: RSpec's 'test double' framework (mocks and stubs) Name: rubygem-%{gem_name} Version: %{majorver} -Release: %{?preminorver:0.}%{fedorarel}%{?preminorver:%{rpmminorver}}%{?dist} +Release: %{?preminorver:0.}%{fedorarel}%{?preminorver:%{rpmminorver}}%{?dist}.1 License: MIT URL: http://github.com/rspec/rspec-mocks @@ -113,6 +113,9 @@ cucumber %{gem_docdir} %changelog +* Fri Jan 20 2023 Fedora Release Engineering - 3.12.0-3.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Fri Dec 2 2022 Mamoru TASAKA - 3.12.0-3 - Backport upstream reviewing patch for ruby32 ruby2_keywords treatment change From b527e5d20d1f5df20e3485bd37110c1dbc1b5814 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Thu, 16 Feb 2023 18:09:39 +0900 Subject: [PATCH 03/29] 3.12.3 --- ...2.0-fixup-argument-forwarding-ruby32.patch | 22 ------------------- rubygem-rspec-mocks.spec | 12 +++++----- sources | 4 ++-- 3 files changed, 8 insertions(+), 30 deletions(-) delete mode 100644 rubygem-rspec-mocks-3.12.0-fixup-argument-forwarding-ruby32.patch diff --git a/rubygem-rspec-mocks-3.12.0-fixup-argument-forwarding-ruby32.patch b/rubygem-rspec-mocks-3.12.0-fixup-argument-forwarding-ruby32.patch deleted file mode 100644 index 6283d02..0000000 --- a/rubygem-rspec-mocks-3.12.0-fixup-argument-forwarding-ruby32.patch +++ /dev/null @@ -1,22 +0,0 @@ -From c1840fcf4a08a2e54aabb18df454544f950f679e Mon Sep 17 00:00:00 2001 -From: ojab -Date: Wed, 16 Nov 2022 22:56:12 +0000 -Subject: [PATCH] Fixup argument forwarding on ruby-3.2 - -Fixes #1495 ---- - lib/rspec/mocks/verifying_proxy.rb | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/lib/rspec/mocks/verifying_proxy.rb b/lib/rspec/mocks/verifying_proxy.rb -index b39871c87..1d8d207dc 100644 ---- a/lib/rspec/mocks/verifying_proxy.rb -+++ b/lib/rspec/mocks/verifying_proxy.rb -@@ -160,6 +160,7 @@ def proxy_method_invoked(obj, *args, &block) - validate_arguments!(args) - super - end -+ ruby2_keywords :proxy_method_invoked if respond_to?(:ruby2_keywords, true) - - def validate_arguments!(actual_args) - @method_reference.with_signature do |signature| diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index 78c3757..454d61a 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -1,9 +1,9 @@ -%global majorver 3.12.0 +%global majorver 3.12.3 #%%global preminorver .rc6 %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} -%global fedorarel 3 +%global fedorarel 1 %global gem_name rspec-mocks @@ -14,7 +14,7 @@ Summary: RSpec's 'test double' framework (mocks and stubs) Name: rubygem-%{gem_name} Version: %{majorver} -Release: %{?preminorver:0.}%{fedorarel}%{?preminorver:%{rpmminorver}}%{?dist}.1 +Release: %{?preminorver:0.}%{fedorarel}%{?preminorver:%{rpmminorver}}%{?dist} License: MIT URL: http://github.com/rspec/rspec-mocks @@ -28,8 +28,6 @@ Patch1: rubygem-rspec-mocks-3.12.0-display_keyword_hashes.patch # ... and related to the above, and commit 66250dc1819f9435e5f584064067e7f05a9afe72 Patch2: rubygem-rspec-mocks-3.12.0-display_keyword_hashes-additional.patch # https://github.com/rspec/rspec-mocks/pull/1502 -# Fixup argument forwarding on ruby-3.2 -Patch3: rubygem-rspec-mocks-3.12.0-fixup-argument-forwarding-ruby32.patch #BuildRequires: ruby(release) BuildRequires: rubygems-devel @@ -67,7 +65,6 @@ gem unpack %{SOURCE0} %patch1 -p1 -R %patch2 -p1 -R %endif -%patch3 -p1 # Cucumber 7 syntax change sed -i cucumber.yml -e "s|~@wip|not @wip|" @@ -113,6 +110,9 @@ cucumber %{gem_docdir} %changelog +* Thu Feb 16 2023 Mamoru TASAKA - 3.12.3-1 +- 3.12.3 + * Fri Jan 20 2023 Fedora Release Engineering - 3.12.0-3.1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild diff --git a/sources b/sources index 10bb7fa..d0e3f30 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rspec-mocks-3.12.0.gem) = eb4a54ac73736e2648c8c14cac1362bafd59452ca54e18f4feb9caa5c5412a449c1cdd9909bd8bfb17f3bcb83c189ab722cbdd409b3942c09f12f427742fd964 -SHA512 (rubygem-rspec-mocks-3.12.0-full.tar.gz) = 808d6fd1b0e71e2ab026650a3fb142a3d806d8f54183f08b379cc20b789982ec1dca791535dcf29ea3f1954909a75b83291397479fe87f1054123a0a5411cdd6 +SHA512 (rspec-mocks-3.12.3.gem) = a4a02d11f41448d9518b736f9d73641c259b6e2872c8b13208db3d1c9b488735e60f6087dfc53b42ed973e87a2c4befe77b8c348a124dd39fe2ed759a09189ee +SHA512 (rubygem-rspec-mocks-3.12.3-full.tar.gz) = 7b18c321c9562d7a642bb37a8bb724f86ef6f51c56b6c634ec01056285919467818bff58a7cf986b9c33d26cf0dc99aaff67f65a758975dfcc40751bc7f0d642 From 1cbc29fbadc4bd292ff53e31d0176962d93bc8ac Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Wed, 8 Mar 2023 17:05:44 -0500 Subject: [PATCH 04/29] Fix ELN build The patches do not apply against the current version, but regardless, the condition is incorrect for the stated intention. Also, remove test dependencies that are unwanted in RHEL/ELN. --- rubygem-rspec-mocks.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index 454d61a..0a15adc 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -36,10 +36,12 @@ BuildRequires: rubygems-devel BuildRequires: rubygem(rspec) BuildRequires: rubygem(thread_order) BuildRequires: rubygem(rake) +%if %{undefined rhel} # cucumber BuildRequires: rubygem(aruba) BuildRequires: rubygem(cucumber) BuildRequires: rubygem(minitest) +%endif BuildRequires: git %endif BuildArch: noarch @@ -60,7 +62,7 @@ This package contains documentation for %{name}. gem unpack %{SOURCE0} %setup -q -D -T -n %{gem_name}-%{version} -b 1 -%if 0%{?fedora} <= 37 +%if 0%{?fedora} && 0%{?fedora} <= 37 # Revert "display_keyword_hashes" for now on Fedora 37 %patch1 -p1 -R %patch2 -p1 -R @@ -90,9 +92,11 @@ rm -f %{buildroot}%{gem_instdir}/{.document,.yardopts} LANG=C.UTF-8 export RUBYLIB=$(pwd)/lib rspec spec/ +%if %{undefined rhel} export CUCUMBER_PUBLISH_QUIET=true cucumber %endif +%endif %files %dir %{gem_instdir} From 60348c9329e08ad0bbc972aa069253fa9a5d918b Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Thu, 9 Mar 2023 16:28:46 +0900 Subject: [PATCH 05/29] Disable unwanted dependencies in RHEL builds --- rubygem-rspec-mocks.spec | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index 0a15adc..fb04236 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -3,7 +3,7 @@ %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} -%global fedorarel 1 +%global fedorarel 2 %global gem_name rspec-mocks @@ -87,16 +87,22 @@ cp -a .%{gem_dir}/* \ rm -f %{buildroot}%{gem_instdir}/{.document,.yardopts} %check -%if %{without bootstrap} +%if %{with bootstrap} +# Don't do actual check +exit 0 +%endif + # library_wide_checks.rb needs UTF-8 LANG=C.UTF-8 export RUBYLIB=$(pwd)/lib rspec spec/ -%if %{undefined rhel} + +%if 0%{?rhel} +# Don't do cucumber test +exit 0 +%endif export CUCUMBER_PUBLISH_QUIET=true cucumber -%endif -%endif %files %dir %{gem_instdir} @@ -114,6 +120,9 @@ cucumber %{gem_docdir} %changelog +* Thu Mar 09 2023 Yaakov Selkowitz - 3.12.3-2 +- Disable unwanted dependencies in RHEL builds + * Thu Feb 16 2023 Mamoru TASAKA - 3.12.3-1 - 3.12.3 From a21d562ba0246df2c719dc16a4980c0ecedf928a Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Mon, 13 Mar 2023 10:36:40 +0900 Subject: [PATCH 06/29] rename release macro to make rpmdev-bumprelease work --- rubygem-rspec-mocks.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index fb04236..ae404b6 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -3,7 +3,7 @@ %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} -%global fedorarel 2 +%global baserelease 2 %global gem_name rspec-mocks @@ -14,7 +14,7 @@ Summary: RSpec's 'test double' framework (mocks and stubs) Name: rubygem-%{gem_name} Version: %{majorver} -Release: %{?preminorver:0.}%{fedorarel}%{?preminorver:%{rpmminorver}}%{?dist} +Release: %{?preminorver:0.}%{baserelease}%{?preminorver:%{rpmminorver}}%{?dist} License: MIT URL: http://github.com/rspec/rspec-mocks From 782f500451f2ed83de35cba544496be80aabab11 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Tue, 14 Mar 2023 16:06:16 +0900 Subject: [PATCH 07/29] 3.12.4 --- rubygem-rspec-mocks.spec | 12 ++++++++++-- sources | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index ae404b6..74aea45 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -1,9 +1,9 @@ -%global majorver 3.12.3 +%global majorver 3.12.4 #%%global preminorver .rc6 %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} -%global baserelease 2 +%global baserelease 1 %global gem_name rspec-mocks @@ -16,6 +16,7 @@ Name: rubygem-%{gem_name} Version: %{majorver} Release: %{?preminorver:0.}%{baserelease}%{?preminorver:%{rpmminorver}}%{?dist} +# SPDX confirmed License: MIT URL: http://github.com/rspec/rspec-mocks Source0: https://rubygems.org/gems/%{gem_name}-%{fullver}.gem @@ -92,6 +93,10 @@ rm -f %{buildroot}%{gem_instdir}/{.document,.yardopts} exit 0 %endif +# Don't call bundler +sed -i spec/integration/rails_support_spec.rb \ + -e 's|bundle exec rspec|rspec|' + # library_wide_checks.rb needs UTF-8 LANG=C.UTF-8 export RUBYLIB=$(pwd)/lib @@ -120,6 +125,9 @@ cucumber %{gem_docdir} %changelog +* Tue Mar 14 2023 Mamoru TASAKA - 3.12.4-1 +- 3.12.4 + * Thu Mar 09 2023 Yaakov Selkowitz - 3.12.3-2 - Disable unwanted dependencies in RHEL builds diff --git a/sources b/sources index d0e3f30..a3da9c3 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rspec-mocks-3.12.3.gem) = a4a02d11f41448d9518b736f9d73641c259b6e2872c8b13208db3d1c9b488735e60f6087dfc53b42ed973e87a2c4befe77b8c348a124dd39fe2ed759a09189ee -SHA512 (rubygem-rspec-mocks-3.12.3-full.tar.gz) = 7b18c321c9562d7a642bb37a8bb724f86ef6f51c56b6c634ec01056285919467818bff58a7cf986b9c33d26cf0dc99aaff67f65a758975dfcc40751bc7f0d642 +SHA512 (rspec-mocks-3.12.4.gem) = 0662dff9279bf16fcc3c63801b72db4702f2a3bcf8884cb07006a8a45016bdf746cf656d03433ac83d26dc53bf36f5cf02e578199c481b84a3b88235c9747300 +SHA512 (rubygem-rspec-mocks-3.12.4-full.tar.gz) = 125a3a0028632af8a5c8d2f46fa8bab8e41c95ddf6ec5d25ccda326ce769bf5e4cf792899758e946b064c9c91f80aad163cb8cc29bcd07a6846dd7f635b8ccc8 From 73e82a735096e706a016dd103a433b9393552fe9 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Sat, 1 Apr 2023 16:34:03 +0900 Subject: [PATCH 08/29] 3.12.5 --- rubygem-rspec-mocks.spec | 6 ++++-- sources | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index 74aea45..af0b86d 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -1,4 +1,4 @@ -%global majorver 3.12.4 +%global majorver 3.12.5 #%%global preminorver .rc6 %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} @@ -30,7 +30,6 @@ Patch1: rubygem-rspec-mocks-3.12.0-display_keyword_hashes.patch Patch2: rubygem-rspec-mocks-3.12.0-display_keyword_hashes-additional.patch # https://github.com/rspec/rspec-mocks/pull/1502 -#BuildRequires: ruby(release) BuildRequires: rubygems-devel %if %{without bootstrap} # rspec @@ -125,6 +124,9 @@ cucumber %{gem_docdir} %changelog +* Sat Apr 1 2023 Mamoru TASAKA - 3.12.5-1 +- 3.12.5 + * Tue Mar 14 2023 Mamoru TASAKA - 3.12.4-1 - 3.12.4 diff --git a/sources b/sources index a3da9c3..c31b80d 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rspec-mocks-3.12.4.gem) = 0662dff9279bf16fcc3c63801b72db4702f2a3bcf8884cb07006a8a45016bdf746cf656d03433ac83d26dc53bf36f5cf02e578199c481b84a3b88235c9747300 -SHA512 (rubygem-rspec-mocks-3.12.4-full.tar.gz) = 125a3a0028632af8a5c8d2f46fa8bab8e41c95ddf6ec5d25ccda326ce769bf5e4cf792899758e946b064c9c91f80aad163cb8cc29bcd07a6846dd7f635b8ccc8 +SHA512 (rspec-mocks-3.12.5.gem) = 64247c62085f633cbdd467848c750051673e1826b7659046a9933e6cb885e776782f2ca071175201d0cffc7beed953a3c76d4b453e0df1e5a444f45a827661f4 +SHA512 (rubygem-rspec-mocks-3.12.5-full.tar.gz) = 56bfa17d035bf39f2e3ec6bf1958e7b323dcb0de94c8585dd27c47f5c20bfad96f9b0d5cee9fc80ed64ef50ca938022211d18de59abe9bc3059e077110ca17df From 2d95f7b05287d56c25726975c610a47c8a3b3521 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Fri, 2 Jun 2023 15:46:05 -0400 Subject: [PATCH 09/29] Fix RHEL build The aruba dependency is already avoided in BuildRequires, but these files require aruba. They cannot be removed though, as the tests fail if they are absent. --- rubygem-rspec-mocks.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index af0b86d..2fe8c61 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -92,9 +92,15 @@ rm -f %{buildroot}%{gem_instdir}/{.document,.yardopts} exit 0 %endif +%if %{defined rhel} +# avoid aruba dep on RHEL, but tests fail if files are removed entirely +echo -n > spec/integration/rails_support_spec.rb +echo -n > spec/support/aruba.rb +%else # Don't call bundler sed -i spec/integration/rails_support_spec.rb \ -e 's|bundle exec rspec|rspec|' +%endif # library_wide_checks.rb needs UTF-8 LANG=C.UTF-8 From 0ea2b628dbd5aba6558406db8dc56e12c8407757 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Sun, 16 Jul 2023 16:14:37 +0900 Subject: [PATCH 10/29] 3.12.6 --- rubygem-rspec-mocks.spec | 5 ++++- sources | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index 2fe8c61..28024a1 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -1,4 +1,4 @@ -%global majorver 3.12.5 +%global majorver 3.12.6 #%%global preminorver .rc6 %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} @@ -130,6 +130,9 @@ cucumber %{gem_docdir} %changelog +* Sun Jul 16 2023 Mamoru TASAKA - 3.12.6-1 +- 3.12.6 + * Sat Apr 1 2023 Mamoru TASAKA - 3.12.5-1 - 3.12.5 diff --git a/sources b/sources index c31b80d..6699e52 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rspec-mocks-3.12.5.gem) = 64247c62085f633cbdd467848c750051673e1826b7659046a9933e6cb885e776782f2ca071175201d0cffc7beed953a3c76d4b453e0df1e5a444f45a827661f4 -SHA512 (rubygem-rspec-mocks-3.12.5-full.tar.gz) = 56bfa17d035bf39f2e3ec6bf1958e7b323dcb0de94c8585dd27c47f5c20bfad96f9b0d5cee9fc80ed64ef50ca938022211d18de59abe9bc3059e077110ca17df +SHA512 (rspec-mocks-3.12.6.gem) = 982505b46c4ddee7a91bd2473d08b9cf0dbc431394a356f7e72306f5fa5e8895f6df378fc32e1fd48a3f3a4ad06393da90124ed164bf620d9f3b0894797a44a9 +SHA512 (rubygem-rspec-mocks-3.12.6-full.tar.gz) = 28b27122fd7f0411b9a41b69906d08c6c26922c788bb2b88fd8d0d10f3c6868851444fc7622c1e593fff6d024a92f7548d9969a895af715125b7ba8c9052faea From cf6a009f483f45651052b997e4c53f1cd2f66625 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 21 Jul 2023 18:20:39 +0000 Subject: [PATCH 11/29] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- rubygem-rspec-mocks.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index 28024a1..943e9df 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -3,7 +3,7 @@ %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} -%global baserelease 1 +%global baserelease 2 %global gem_name rspec-mocks @@ -130,6 +130,9 @@ cucumber %{gem_docdir} %changelog +* Fri Jul 21 2023 Fedora Release Engineering - 3.12.6-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Sun Jul 16 2023 Mamoru TASAKA - 3.12.6-1 - 3.12.6 From c57755089769cd62cd9717121a864e95baa0a3cd Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 26 Jan 2024 17:26:50 +0000 Subject: [PATCH 12/29] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- rubygem-rspec-mocks.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index 943e9df..6e1f21b 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -3,7 +3,7 @@ %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} -%global baserelease 2 +%global baserelease 3 %global gem_name rspec-mocks @@ -130,6 +130,9 @@ cucumber %{gem_docdir} %changelog +* Fri Jan 26 2024 Fedora Release Engineering - 3.12.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Fri Jul 21 2023 Fedora Release Engineering - 3.12.6-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From a818ea319398760ca0520a289fc9bde418e8a311 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Fri, 9 Feb 2024 15:22:52 +0900 Subject: [PATCH 13/29] 3.13.0 --- rubygem-rspec-mocks.spec | 9 ++++++--- sources | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index 6e1f21b..8fbc8a8 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -1,13 +1,13 @@ -%global majorver 3.12.6 +%global majorver 3.13.0 #%%global preminorver .rc6 %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} -%global baserelease 3 +%global baserelease 1 %global gem_name rspec-mocks -%bcond_with bootstrap +%bcond_without bootstrap %undefine __brp_mangle_shebangs @@ -130,6 +130,9 @@ cucumber %{gem_docdir} %changelog +* Fri Feb 09 2024 Mamoru TASAKA - 3.13.0-1 +- 3.13.0 + * Fri Jan 26 2024 Fedora Release Engineering - 3.12.6-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild diff --git a/sources b/sources index 6699e52..b436f87 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rspec-mocks-3.12.6.gem) = 982505b46c4ddee7a91bd2473d08b9cf0dbc431394a356f7e72306f5fa5e8895f6df378fc32e1fd48a3f3a4ad06393da90124ed164bf620d9f3b0894797a44a9 -SHA512 (rubygem-rspec-mocks-3.12.6-full.tar.gz) = 28b27122fd7f0411b9a41b69906d08c6c26922c788bb2b88fd8d0d10f3c6868851444fc7622c1e593fff6d024a92f7548d9969a895af715125b7ba8c9052faea +SHA512 (rspec-mocks-3.13.0.gem) = 098aae28f94124071047602e41dc76a8941a5625ea21c554c040aea9973ea285928acadf42cbf361753b84d2d5a21166da6589cf98cc0a2d3edcf0a1280df1d6 +SHA512 (rubygem-rspec-mocks-3.13.0-full.tar.gz) = cb92e9305a0f2361eaf9dd09f18dd3c7c771b83ec44a959ee613205cfe67214dcf1b26020009d6c4141b3f0de9c720d8e1b79cebf117b51d563c26a95a17dd0c From 284f768d3d10bc98657aa18819246e2abf2079e8 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Fri, 9 Feb 2024 15:46:11 +0900 Subject: [PATCH 14/29] enable test again --- rubygem-rspec-mocks.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index 8fbc8a8..fde97b8 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -7,7 +7,7 @@ %global gem_name rspec-mocks -%bcond_without bootstrap +%bcond_with bootstrap %undefine __brp_mangle_shebangs From ccc4fd302ab53bae4980b9fcbd64d052dd8401e6 Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Wed, 17 Apr 2024 18:19:07 +0200 Subject: [PATCH 15/29] Remove unused thread_order build dependency. --- rubygem-rspec-mocks.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index fde97b8..f4cfe79 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -34,7 +34,6 @@ BuildRequires: rubygems-devel %if %{without bootstrap} # rspec BuildRequires: rubygem(rspec) -BuildRequires: rubygem(thread_order) BuildRequires: rubygem(rake) %if %{undefined rhel} # cucumber From 898969673b6c5b3bff1d42be769730e704b8b257 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Thu, 18 Apr 2024 20:21:50 +0900 Subject: [PATCH 16/29] bump release and build --- rubygem-rspec-mocks.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index f4cfe79..2c9a1fd 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -3,7 +3,7 @@ %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} -%global baserelease 1 +%global baserelease 2 %global gem_name rspec-mocks @@ -129,6 +129,9 @@ cucumber %{gem_docdir} %changelog +* Thu Apr 18 2024 Jun Aruga - 3.13.0-2 +- Remove unused thread_order build dependency + * Fri Feb 09 2024 Mamoru TASAKA - 3.13.0-1 - 3.13.0 From c7006f9137bce320f6cf96cbd185a86ce51f5c39 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Thu, 9 May 2024 17:23:35 +0900 Subject: [PATCH 17/29] 3.13.1 --- ....0-display_keyword_hashes-additional.patch | 12 -- ...-mocks-3.12.0-display_keyword_hashes.patch | 109 ------------------ rubygem-rspec-mocks.spec | 18 +-- sources | 4 +- 4 files changed, 7 insertions(+), 136 deletions(-) delete mode 100644 rubygem-rspec-mocks-3.12.0-display_keyword_hashes-additional.patch delete mode 100644 rubygem-rspec-mocks-3.12.0-display_keyword_hashes.patch diff --git a/rubygem-rspec-mocks-3.12.0-display_keyword_hashes-additional.patch b/rubygem-rspec-mocks-3.12.0-display_keyword_hashes-additional.patch deleted file mode 100644 index 500ad7e..0000000 --- a/rubygem-rspec-mocks-3.12.0-display_keyword_hashes-additional.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -urp -x .git rspec-mocks-3.11.2/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb rspec-mocks-3.12.0/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb ---- rspec-mocks-3.11.2/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb 2022-10-26 16:39:18.000000000 +0900 -+++ rspec-mocks-3.12.0/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb 2022-10-27 14:34:37.000000000 +0900 -@@ -135,7 +135,7 @@ module RSpec - expect(dbl).to receive(:kw_args_method).with(1, :required_arg => 2, :optional_arg => 3) - expect do - dbl.kw_args_method(1, {:required_arg => 2, :optional_arg => 3}) -- end.to fail_with(a_string_including("expected: (1, {:optional_arg=>3, :required_arg=>2})", "got: (1, {:optional_arg=>3, :required_arg=>2})")) -+ end.to fail_with(a_string_including("expected: (1, {:optional_arg=>3, :required_arg=>2}) (keyword arguments)", "got: (1, {:optional_arg=>3, :required_arg=>2}) (options hash)")) - end - else - it "matches against a hash submitted as a positional argument and received as keyword arguments in Ruby 2.7 or before" do diff --git a/rubygem-rspec-mocks-3.12.0-display_keyword_hashes.patch b/rubygem-rspec-mocks-3.12.0-display_keyword_hashes.patch deleted file mode 100644 index cc6ea7c..0000000 --- a/rubygem-rspec-mocks-3.12.0-display_keyword_hashes.patch +++ /dev/null @@ -1,109 +0,0 @@ -From e931e818b577172b89fb4583fc336fbcd25df36b Mon Sep 17 00:00:00 2001 -From: Jean Boussier -Date: Fri, 18 Feb 2022 11:19:47 +0100 -Subject: [PATCH] Display keyword hashes in in expectation error messages - -Ref: https://github.com/vcr/vcr/pull/925 -Ref: https://github.com/rspec/rspec-mocks/pull/1394 - -I spent quite a lot of time figuring this error: - -``` - 2) VCR.turned_on passes options through to .turn_off! - Failure/Error: turn_off!(options) - - VCR received :turn_off! with unexpected arguments - expected: ({:ignore_cassettes=>true}) - got: ({:ignore_cassettes=>true}) - # ./lib/vcr.rb:317:in `turned_on' - # ./spec/lib/vcr_spec.rb:367:in `block (3 levels) in ' -``` - -I quickly suspected it was a keyword argument issue, but it's far from -obvious to everyone, and even when you are familair with the issue -it doesn't tell you what was expected and what was received. - -I doubt the way I implemented this is ok, but I think it's worth -opening the discussion - -``` - 2) VCR.turned_on passes options through to .turn_off! - Failure/Error: turn_off!(options) - - VCR received :turn_off! with unexpected arguments - expected: ({:ignore_cassettes=>true}) (keyword arguments) - got: ({:ignore_cassettes=>true}) (options hash) - # ./lib/vcr.rb:317:in `turned_on' - # ./spec/lib/vcr_spec.rb:367:in `block (3 levels) in ' -``` ---- - lib/rspec/mocks/error_generator.rb | 11 ++++++++++ - spec/rspec/mocks/diffing_spec.rb | 33 ++++++++++++++++++++++++++++++ - 2 files changed, 44 insertions(+) - -diff --git a/lib/rspec/mocks/error_generator.rb b/lib/rspec/mocks/error_generator.rb -index 9bf0984f3..42ff35283 100644 ---- a/lib/rspec/mocks/error_generator.rb -+++ b/lib/rspec/mocks/error_generator.rb -@@ -268,6 +268,17 @@ def unexpected_arguments_message(expected_args_string, actual_args_string) - def error_message(expectation, args_for_multiple_calls) - expected_args = format_args(expectation.expected_args) - actual_args = format_received_args(args_for_multiple_calls) -+ -+ if RSpec::Support::RubyFeatures.distincts_kw_args_from_positional_hash? && expected_args == actual_args -+ expected_hash = expectation.expected_args.last -+ actual_hash = args_for_multiple_calls.last.last -+ if Hash === expected_hash && Hash === actual_hash && -+ (Hash.ruby2_keywords_hash?(expected_hash) != Hash.ruby2_keywords_hash?(actual_hash)) -+ actual_args += Hash.ruby2_keywords_hash?(actual_hash) ? " (keyword arguments)" : " (options hash)" -+ expected_args += Hash.ruby2_keywords_hash?(expected_hash) ? " (keyword arguments)" : " (options hash)" -+ end -+ end -+ - message = default_error_message(expectation, expected_args, actual_args) - - if args_for_multiple_calls.one? -diff --git a/spec/rspec/mocks/diffing_spec.rb b/spec/rspec/mocks/diffing_spec.rb -index 3b1f91edf..e17aabcd3 100644 ---- a/spec/rspec/mocks/diffing_spec.rb -+++ b/spec/rspec/mocks/diffing_spec.rb -@@ -83,6 +83,39 @@ - end - end - -+ if RSpec::Support::RubyFeatures.distincts_kw_args_from_positional_hash? -+ eval <<-'RUBY', nil, __FILE__, __LINE__ + 1 -+ it "print a diff when keyword argument were expected but got an option hash (using splat)" do -+ with_unfulfilled_double do |d| -+ expect(d).to receive(:foo).with(**expected_hash) -+ expect { -+ d.foo(expected_hash) -+ }.to fail_with( -+ "# received :foo with unexpected arguments\n" \ -+ " expected: ({:baz=>:quz, :foo=>:bar}) (keyword arguments)\n" \ -+ " got: ({:baz=>:quz, :foo=>:bar}) (options hash)" -+ ) -+ end -+ end -+ RUBY -+ -+ eval <<-'RUBY', nil, __FILE__, __LINE__ + 1 -+ it "print a diff when keyword argument were expected but got an option hash (literal)" do -+ with_unfulfilled_double do |d| -+ expect(d).to receive(:foo).with(:positional, keyword: 1) -+ expect { -+ options = { keyword: 1 } -+ d.foo(:positional, options) -+ }.to fail_with( -+ "# received :foo with unexpected arguments\n" \ -+ " expected: (:positional, {:keyword=>1}) (keyword arguments)\n" \ -+ " got: (:positional, {:keyword=>1}) (options hash)" -+ ) -+ end -+ end -+ RUBY -+ end -+ - if RUBY_VERSION.to_f < 1.9 - # Ruby 1.8 hashes are not ordered, but `#inspect` on a particular unchanged - # hash instance should return consistent output. However, on Travis that does diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index 2c9a1fd..5f2d42f 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -1,9 +1,9 @@ -%global majorver 3.13.0 +%global majorver 3.13.1 #%%global preminorver .rc6 %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} -%global baserelease 2 +%global baserelease 1 %global gem_name rspec-mocks @@ -23,12 +23,6 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{fullver}.gem # %%{SOURCE2} %%{name} %%{version} Source1: rubygem-%{gem_name}-%{version}-full.tar.gz Source2: rspec-related-create-full-tarball.sh -# https://github.com/rspec/rspec-mocks/commit/e931e818b577172b89fb4583fc336fbcd25df36b -# The above is in 3.12.x branch, not in 3.11.x branch -Patch1: rubygem-rspec-mocks-3.12.0-display_keyword_hashes.patch -# ... and related to the above, and commit 66250dc1819f9435e5f584064067e7f05a9afe72 -Patch2: rubygem-rspec-mocks-3.12.0-display_keyword_hashes-additional.patch -# https://github.com/rspec/rspec-mocks/pull/1502 BuildRequires: rubygems-devel %if %{without bootstrap} @@ -61,11 +55,6 @@ This package contains documentation for %{name}. gem unpack %{SOURCE0} %setup -q -D -T -n %{gem_name}-%{version} -b 1 -%if 0%{?fedora} && 0%{?fedora} <= 37 -# Revert "display_keyword_hashes" for now on Fedora 37 -%patch1 -p1 -R -%patch2 -p1 -R -%endif # Cucumber 7 syntax change sed -i cucumber.yml -e "s|~@wip|not @wip|" @@ -129,6 +118,9 @@ cucumber %{gem_docdir} %changelog +* Thu May 09 2024 Mamoru TASAKA - 3.13.1-1 +- 3.13.1 + * Thu Apr 18 2024 Jun Aruga - 3.13.0-2 - Remove unused thread_order build dependency diff --git a/sources b/sources index b436f87..2dcb9fa 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rspec-mocks-3.13.0.gem) = 098aae28f94124071047602e41dc76a8941a5625ea21c554c040aea9973ea285928acadf42cbf361753b84d2d5a21166da6589cf98cc0a2d3edcf0a1280df1d6 -SHA512 (rubygem-rspec-mocks-3.13.0-full.tar.gz) = cb92e9305a0f2361eaf9dd09f18dd3c7c771b83ec44a959ee613205cfe67214dcf1b26020009d6c4141b3f0de9c720d8e1b79cebf117b51d563c26a95a17dd0c +SHA512 (rspec-mocks-3.13.1.gem) = 8010254fecf570ece1e9269ac92db36df4f562c72c71bc8fc3b891d5b9c03ad900eb994f454a5c016c01ced79c552c537f5589a8eb28101764264a5890986831 +SHA512 (rubygem-rspec-mocks-3.13.1-full.tar.gz) = a9e186edc1a630985c2642c7b7b539616854756c3ee808c1f55cb42eec565d3c7f6d11fc48646ad5f39756712995bdaba3a398ce87a37831075756708fbed0ce From e5b0f4df0bff3c50825b952d56d17e0cca7af993 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 19 Jul 2024 19:55:06 +0000 Subject: [PATCH 18/29] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- rubygem-rspec-mocks.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index 5f2d42f..4b224a6 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -3,7 +3,7 @@ %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} -%global baserelease 1 +%global baserelease 2 %global gem_name rspec-mocks @@ -118,6 +118,9 @@ cucumber %{gem_docdir} %changelog +* Fri Jul 19 2024 Fedora Release Engineering - 3.13.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Thu May 09 2024 Mamoru TASAKA - 3.13.1-1 - 3.13.1 From 3665cf0e866427ac56de2ae9d6fa30eca02a9558 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Thu, 3 Oct 2024 19:33:47 +0900 Subject: [PATCH 19/29] 3.13.2 --- rubygem-rspec-mocks.spec | 7 +++++-- sources | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index 4b224a6..3fda021 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -1,9 +1,9 @@ -%global majorver 3.13.1 +%global majorver 3.13.2 #%%global preminorver .rc6 %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} -%global baserelease 2 +%global baserelease 1 %global gem_name rspec-mocks @@ -118,6 +118,9 @@ cucumber %{gem_docdir} %changelog +* Thu Oct 03 2024 Mamoru TASAKA - 3.13.2-1 +- 3.13.2 + * Fri Jul 19 2024 Fedora Release Engineering - 3.13.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild diff --git a/sources b/sources index 2dcb9fa..b62a81b 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rspec-mocks-3.13.1.gem) = 8010254fecf570ece1e9269ac92db36df4f562c72c71bc8fc3b891d5b9c03ad900eb994f454a5c016c01ced79c552c537f5589a8eb28101764264a5890986831 -SHA512 (rubygem-rspec-mocks-3.13.1-full.tar.gz) = a9e186edc1a630985c2642c7b7b539616854756c3ee808c1f55cb42eec565d3c7f6d11fc48646ad5f39756712995bdaba3a398ce87a37831075756708fbed0ce +SHA512 (rspec-mocks-3.13.2.gem) = 3284411d5f9c3b10aca0ca41bfeec4ec423b1d2effb1942a36ff61c741ff8b1281ae69d46086881f99fc3e70522cf6a31805e980fe270e35cc35c6d8376c9152 +SHA512 (rubygem-rspec-mocks-3.13.2-full.tar.gz) = 79a22d5356247e4d563868589f512018f51a235aafa9d001d81673c73bc1d0a04be7c4770518744f77dfb4e7f726b5c037384a5f14cd853202466b68e4398e9c From 1c042ffadcdc15621f91e4de11bb5e9fc139dcf2 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Wed, 6 Nov 2024 17:09:00 +0900 Subject: [PATCH 20/29] Backport upstream patch to support ruby34 formatting --- rspec-mocks-pr1597-ruby34-formatting.patch | 429 +++++++++++++++++++++ rubygem-rspec-mocks.spec | 10 +- 2 files changed, 438 insertions(+), 1 deletion(-) create mode 100644 rspec-mocks-pr1597-ruby34-formatting.patch diff --git a/rspec-mocks-pr1597-ruby34-formatting.patch b/rspec-mocks-pr1597-ruby34-formatting.patch new file mode 100644 index 0000000..e99a6eb --- /dev/null +++ b/rspec-mocks-pr1597-ruby34-formatting.patch @@ -0,0 +1,429 @@ +From f8b49348d02d0220e20391665f7418f9212dac02 Mon Sep 17 00:00:00 2001 +From: Jon Rowe +Date: Fri, 18 Oct 2024 21:39:26 +0100 +Subject: [PATCH] Relax specs for Ruby 3.4 hash formatting + +--- + .../matching_arguments.feature | 6 +- + .../step_definitions/additional_cli_steps.rb | 7 +- + spec/rspec/mocks/argument_matchers_spec.rb | 14 ++-- + spec/rspec/mocks/diffing_spec.rb | 84 ++++++++++++------- + spec/rspec/mocks/double_spec.rb | 9 +- + .../mocks/hash_excluding_matcher_spec.rb | 9 +- + .../mocks/hash_including_matcher_spec.rb | 9 +- + spec/rspec/mocks/matchers/receive_spec.rb | 26 ++++-- + .../expected_arg_verification_spec.rb | 11 ++- + 9 files changed, 124 insertions(+), 51 deletions(-) + +diff --git a/features/setting_constraints/matching_arguments.feature b/features/setting_constraints/matching_arguments.feature +index caea74248..cad5cea4c 100644 +--- a/features/setting_constraints/matching_arguments.feature ++++ b/features/setting_constraints/matching_arguments.feature +@@ -73,7 +73,7 @@ Feature: Matching arguments + end + """ + When I run `rspec keyword_example_spec.rb` +- Then it should fail with the following output: ++ Then it should fail with the following output, ignoring hash syntax: + | 2 examples, 1 failure | + | | + | Failure/Error: dbl.foo(bar: "incorrect") | +@@ -100,7 +100,7 @@ Feature: Matching arguments + end + """ + When I run `rspec keyword_example_spec.rb` +- Then it should fail with the following output: ++ Then it should fail with the following output, ignoring hash syntax: + | 1 example, 1 failure | + | | + | Failure/Error: dbl.foo({bar: "also incorrect"}) | +@@ -156,7 +156,7 @@ Feature: Matching arguments + end + """ + When I run `rspec rspec_satisfy_spec.rb` +- Then it should fail with the following output: ++ Then it should fail with the following output, ignoring hash syntax: + | 2 examples, 1 failure | + | | + | Failure/Error: dbl.foo({ :a => { :b => { :c => 3 } } }) | +diff --git a/features/step_definitions/additional_cli_steps.rb b/features/step_definitions/additional_cli_steps.rb +index 77f8c0f30..acf1117e0 100644 +--- a/features/step_definitions/additional_cli_steps.rb ++++ b/features/step_definitions/additional_cli_steps.rb +@@ -22,8 +22,13 @@ + diffable + end + +-Then /^it should fail with the following output:$/ do |table| ++Then /^it should fail with the following output(, ignoring hash syntax)?:$/ do |ignore_hash_syntax, table| + step %q(the exit status should be 1) + lines = table.raw.flatten.reject(&:empty?) ++ ++ if ignore_hash_syntax && RUBY_VERSION.to_f > 3.3 ++ lines = lines.map { |line| line.gsub(/([^\s])=>/, '\1 => ') } ++ end ++ + expect(all_output).to match_table(lines) + end +diff --git a/spec/rspec/mocks/argument_matchers_spec.rb b/spec/rspec/mocks/argument_matchers_spec.rb +index eb101a04c..8f31d1786 100644 +--- a/spec/rspec/mocks/argument_matchers_spec.rb ++++ b/spec/rspec/mocks/argument_matchers_spec.rb +@@ -256,7 +256,7 @@ module Mocks + expect(a_double).to receive(:random_call).with(hash_including(:a => 1)) + expect { + a_double.random_call(:a => 2) +- }.to fail_including "expected: (hash_including(:a=>1))" ++ }.to fail_including "expected: (hash_including(#{hash_syntax(:a => 1)}))" + end + end + +@@ -270,7 +270,7 @@ module Mocks + expect(a_double).to receive(:random_call).with(hash_excluding(:a => 1)) + expect { + a_double.random_call(:a => 1) +- }.to fail_including "expected: (hash_not_including(:a=>1))" ++ }.to fail_including "expected: (hash_not_including(#{hash_syntax(:a => 1)}))" + end + end + +@@ -431,7 +431,7 @@ def ==(other) + expect(a_double).to receive(:random_call).with(:a => "a", :b => "b") + expect do + a_double.random_call(opts) +- end.to fail_with(/expected: \(\{(:a=>\"a\", :b=>\"b\"|:b=>\"b\", :a=>\"a\")\}\)/) ++ end.to fail_with(/expected: \(\{(:a\s*=>\s*\"a\", :b\s*=>\s*\"b\"|:b\s*=>\s*\"b\", :a\s*=>\s*\"a\")\}\)/) + end + else + it "matches against a hash submitted as a positional argument and received as keyword arguments in Ruby 2.7 or before" do +@@ -445,14 +445,14 @@ def ==(other) + expect(a_double).to receive(:random_call).with(:a => "b", :c => "d") + expect do + a_double.random_call(:a => "b", :c => "e") +- end.to fail_with(/expected: \(\{(:a=>\"b\", :c=>\"d\"|:c=>\"d\", :a=>\"b\")\}\)/) ++ end.to fail_with(/expected: \(\{(:a\s*=>\s*\"b\", :c\s*=>\s*\"d\"|:c\s*=>\s*\"d\", :a\s*=>\s*\"b\")\}\)/) + end + + it "fails for a hash w/ wrong keys", :reset => true do + expect(a_double).to receive(:random_call).with(:a => "b", :c => "d") + expect do + a_double.random_call("a" => "b", "c" => "d") +- end.to fail_with(/expected: \(\{(:a=>\"b\", :c=>\"d\"|:c=>\"d\", :a=>\"b\")\}\)/) ++ end.to fail_with(/expected: \(\{(:a\s*=>\s*\"b\", :c\s*=>\s*\"d\"|:c\s*=>\s*\"d\", :a\s*=>\s*\"b\")\}\)/) + end + + it "matches a class against itself" do +@@ -502,6 +502,10 @@ def ==(other) + expect { a_double.msg 3 }.to fail_including "expected: (my_thing)" + end + end ++ ++ def hash_syntax(hash) ++ hash.inspect.gsub(/\{(.*)\}/, '\1') ++ end + end + end + end +diff --git a/spec/rspec/mocks/diffing_spec.rb b/spec/rspec/mocks/diffing_spec.rb +index e40fa55b6..8be6510da 100644 +--- a/spec/rspec/mocks/diffing_spec.rb ++++ b/spec/rspec/mocks/diffing_spec.rb +@@ -100,15 +100,18 @@ + if RSpec::Support::RubyFeatures.distincts_kw_args_from_positional_hash? + eval <<-'RUBY', nil, __FILE__, __LINE__ + 1 + it "prints a diff when keyword argument were expected but got an option hash (using splat)" do ++ message = ++ "# received :foo with unexpected arguments\n" \ ++ " expected: ({:baz=>:quz, :foo=>:bar}) (keyword arguments)\n" \ ++ " got: ({:baz=>:quz, :foo=>:bar}) (options hash)" ++ ++ message = message.gsub('=>', ' => ') if RUBY_VERSION.to_f > 3.3 ++ + with_unfulfilled_double do |d| + expect(d).to receive(:foo).with(**expected_hash) + expect { + d.foo(expected_hash) +- }.to fail_with( +- "# received :foo with unexpected arguments\n" \ +- " expected: ({:baz=>:quz, :foo=>:bar}) (keyword arguments)\n" \ +- " got: ({:baz=>:quz, :foo=>:bar}) (options hash)" +- ) ++ }.to fail_with(message) + end + end + RUBY +@@ -117,14 +120,18 @@ + it "prints a diff when keyword argument were expected but got an option hash (literal)" do + with_unfulfilled_double do |d| + expect(d).to receive(:foo).with(:positional, keyword: 1) +- expect { +- options = { keyword: 1 } +- d.foo(:positional, options) +- }.to fail_with( ++ ++ message = + "# received :foo with unexpected arguments\n" \ + " expected: (:positional, {:keyword=>1}) (keyword arguments)\n" \ + " got: (:positional, {:keyword=>1}) (options hash)" +- ) ++ ++ message = message.gsub('=>',' => ') if RUBY_VERSION.to_f > 3.3 ++ ++ expect { ++ options = { keyword: 1 } ++ d.foo(:positional, options) ++ }.to fail_with(message) + end + end + RUBY +@@ -139,10 +146,7 @@ + + expect(d).to receive(:foo).with(expected_input, one: 1) + +- expect { +- options = { one: 1 } +- d.foo(actual_input, options) +- }.to fail_with( ++ message = + "# received :foo with unexpected arguments\n" \ + " expected: (#{expected_input.inspect}, {:one=>1}) (keyword arguments)\n" \ + " got: (#{actual_input.inspect}, {:one=>1}) (options hash)\n" \ +@@ -150,7 +154,13 @@ + "@@ -1 +1 @@\n" \ + "-[#{expected_input.inspect}, {:one=>1}]\n" \ + "+[#{actual_input.inspect}, {:one=>1}]\n" +- ) ++ ++ message = message.gsub('=>',' => ') if RUBY_VERSION.to_f > 3.3 ++ ++ expect { ++ options = { one: 1 } ++ d.foo(actual_input, options) ++ }.to fail_with(message) + end + end + RUBY +@@ -172,28 +182,34 @@ + if RSpec::Support::RubyFeatures.distincts_kw_args_from_positional_hash? + eval <<-'RUBY', nil, __FILE__, __LINE__ + 1 + it "prints a diff when keyword argument were expected but got an option hash (using splat)" do +- expect(d).to receive(:foo).with(:positional, **expected_hash) +- expect { +- d.foo(:positional, expected_hash) +- }.to fail_with( ++ message = + "#{d.inspect} received :foo with unexpected arguments\n" \ + " expected: (:positional, {:baz=>:quz, :foo=>:bar}) (keyword arguments)\n" \ + " got: (:positional, {:baz=>:quz, :foo=>:bar}) (options hash)" +- ) ++ ++ message.gsub!('=>',' => ') if RUBY_VERSION.to_f > 3.3 ++ ++ expect(d).to receive(:foo).with(:positional, **expected_hash) ++ expect { ++ d.foo(:positional, expected_hash) ++ }.to fail_with(message) + end + RUBY + + eval <<-'RUBY', nil, __FILE__, __LINE__ + 1 + it "prints a diff when keyword argument were expected but got an option hash (literal)" do ++ message = ++ "#{d.inspect} received :foo with unexpected arguments\n" \ ++ " expected: (:positional, {:keyword=>1}) (keyword arguments)\n" \ ++ " got: (:positional, {:keyword=>1}) (options hash)" ++ ++ message.gsub!('=>',' => ') if RUBY_VERSION.to_f > 3.3 ++ + expect(d).to receive(:foo).with(:positional, keyword: 1) + expect { + options = { keyword: 1 } + d.foo(:positional, options) +- }.to fail_with( +- "#{d.inspect} received :foo with unexpected arguments\n" \ +- " expected: (:positional, {:keyword=>1}) (keyword arguments)\n" \ +- " got: (:positional, {:keyword=>1}) (options hash)" +- ) ++ }.to fail_with(message) + end + RUBY + +@@ -206,10 +222,7 @@ + + expect(d).to receive(:foo).with(expected_input, one: 1) + +- expect { +- options = { one: 1 } +- d.foo(actual_input, options) +- }.to fail_with( ++ message = + "#{d.inspect} received :foo with unexpected arguments\n" \ + " expected: (#{expected_input.inspect}, {:one=>1}) (keyword arguments)\n" \ + " got: (#{actual_input.inspect}, {:one=>1}) (options hash)\n" \ +@@ -217,7 +230,13 @@ + "@@ -1 +1 @@\n" \ + "-[#{expected_input.inspect}, {:one=>1}]\n" \ + "+[#{actual_input.inspect}, {:one=>1}]\n" +- ) ++ ++ message = message.gsub('=>', ' => ') if RUBY_VERSION.to_f > 3.3 ++ ++ expect { ++ options = { one: 1 } ++ d.foo(actual_input, options) ++ }.to fail_with(message) + end + RUBY + end +@@ -232,6 +251,11 @@ + def hash_regex_inspect(hash) + "\\{(#{hash.map { |key, value| "#{key.inspect}=>#{value.inspect}.*" }.join "|"}){#{hash.size}}\\}" + end ++ elsif RUBY_VERSION.to_f > 3.3 ++ # Ruby head / 3.4 is changing the hash syntax inspect, but we use PP when diffing which just spaces out hashrockets ++ def hash_regex_inspect(hash) ++ Regexp.escape("{#{hash.map { |key, value| "#{key.inspect} => #{value.inspect}"}.join(", ")}}") ++ end + else + def hash_regex_inspect(hash) + Regexp.escape(hash.inspect) +diff --git a/spec/rspec/mocks/double_spec.rb b/spec/rspec/mocks/double_spec.rb +index d5dff63b3..ac65c590f 100644 +--- a/spec/rspec/mocks/double_spec.rb ++++ b/spec/rspec/mocks/double_spec.rb +@@ -526,10 +526,17 @@ def initialize(amount, units) + + if kw_args_supported? + it 'fails when calling yielding method with invalid kw args' do ++ message = ++ if RUBY_VERSION.to_f > 3.3 ++ '# yielded |{:x => 1, :y => 2}| to block with optional keyword args (:x)' ++ else ++ '# yielded |{:x=>1, :y=>2}| to block with optional keyword args (:x)' ++ end ++ + expect(@double).to receive(:yield_back).and_yield(:x => 1, :y => 2) + expect { + eval("@double.yield_back { |x: 1| }") +- }.to fail_with '# yielded |{:x=>1, :y=>2}| to block with optional keyword args (:x)' ++ }.to fail_with message + end + end + +diff --git a/spec/rspec/mocks/hash_excluding_matcher_spec.rb b/spec/rspec/mocks/hash_excluding_matcher_spec.rb +index fc0faed05..3fca99823 100644 +--- a/spec/rspec/mocks/hash_excluding_matcher_spec.rb ++++ b/spec/rspec/mocks/hash_excluding_matcher_spec.rb +@@ -4,7 +4,14 @@ module ArgumentMatchers + RSpec.describe HashExcludingMatcher do + + it "describes itself properly" do +- expect(HashExcludingMatcher.new(:a => 5).description).to eq "hash_not_including(:a=>5)" ++ message = ++ if RUBY_VERSION.to_f > 3.3 ++ "hash_not_including(a: 5)" ++ else ++ "hash_not_including(:a=>5)" ++ end ++ ++ expect(HashExcludingMatcher.new(:a => 5).description).to eq message + end + + describe "passing" do +diff --git a/spec/rspec/mocks/hash_including_matcher_spec.rb b/spec/rspec/mocks/hash_including_matcher_spec.rb +index ad5e8587a..057aec55d 100644 +--- a/spec/rspec/mocks/hash_including_matcher_spec.rb ++++ b/spec/rspec/mocks/hash_including_matcher_spec.rb +@@ -4,7 +4,14 @@ module ArgumentMatchers + RSpec.describe HashIncludingMatcher do + + it "describes itself properly" do +- expect(HashIncludingMatcher.new(:a => 1).description).to eq "hash_including(:a=>1)" ++ message = ++ if RUBY_VERSION.to_f > 3.3 ++ "hash_including(a: 1)" ++ else ++ "hash_including(:a=>1)" ++ end ++ ++ expect(HashIncludingMatcher.new(:a => 1).description).to eq message + end + + it "describes passed matchers" do +diff --git a/spec/rspec/mocks/matchers/receive_spec.rb b/spec/rspec/mocks/matchers/receive_spec.rb +index 1b71dd58f..abf266935 100644 +--- a/spec/rspec/mocks/matchers/receive_spec.rb ++++ b/spec/rspec/mocks/matchers/receive_spec.rb +@@ -130,7 +130,7 @@ def kw_args_method(a:, b:); end + dbl.kw_args_method(a: 1, b: 2) + end + +- if RUBY_VERSION >= '3.0' ++ if RUBY_VERSION.to_f >= 3.0 + it "fails to expect to receive hash with keyword args" do + expect { + dbl = instance_double(TestObject) +@@ -138,9 +138,16 @@ def kw_args_method(a:, b:); end + dbl.kw_args_method({a: 1, b: 2}) + }.to fail_with do |failure| + reset_all +- expect(failure.message) +- .to include('expected: ({:a=>1, :b=>2}) (keyword arguments)') +- .and include('got: ({:a=>1, :b=>2}) (options hash)') ++ ++ if RUBY_VERSION.to_f > 3.3 ++ expect(failure.message) ++ .to include('expected: ({:a => 1, :b => 2}) (keyword arguments)') ++ .and include('got: ({:a => 1, :b => 2}) (options hash)') ++ else ++ expect(failure.message) ++ .to include('expected: ({:a=>1, :b=>2}) (keyword arguments)') ++ .and include('got: ({:a=>1, :b=>2}) (options hash)') ++ end + end + end + else +@@ -505,9 +512,14 @@ def receiver.method_missing(*); end # a poor man's stub... + receiver.foo(1, :bar => 2) + receiver.foo(1, :bar => 3) + +- expect { verify_all }.to( +- raise_error(/received: 2 times with arguments: \(anything, hash_including\(:bar=>"anything"\)\)$/) +- ) ++ message = ++ if RUBY_VERSION.to_f > 3.3 ++ /received: 2 times with arguments: \(anything, hash_including\(bar: "anything"\)\)$/ ++ else ++ /received: 2 times with arguments: \(anything, hash_including\(:bar=>"anything"\)\)$/ ++ end ++ ++ expect { verify_all }.to raise_error(message) + end + end + end +diff --git a/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb b/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb +index d39995341..1860afa1a 100644 +--- a/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb ++++ b/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb +@@ -130,12 +130,19 @@ module Mocks + dbl.kw_args_method(1, :required_arg => 2, :optional_arg => 3) + end + +- if RUBY_VERSION >= "3" ++ if RUBY_VERSION.to_f >= 3.0 + it "fails to match against a hash submitted as a positional argument and received as keyword arguments in Ruby 3.0 or later", :reset => true do ++ messages = ++ if RUBY_VERSION.to_f > 3.3 ++ ["expected: (1, {:optional_arg => 3, :required_arg => 2}) (keyword arguments)", "got: (1, {:optional_arg => 3, :required_arg => 2}) (options hash)"] ++ else ++ ["expected: (1, {:optional_arg=>3, :required_arg=>2}) (keyword arguments)", "got: (1, {:optional_arg=>3, :required_arg=>2}) (options hash)"] ++ end ++ + expect(dbl).to receive(:kw_args_method).with(1, :required_arg => 2, :optional_arg => 3) + expect do + dbl.kw_args_method(1, {:required_arg => 2, :optional_arg => 3}) +- end.to fail_with(a_string_including("expected: (1, {:optional_arg=>3, :required_arg=>2}) (keyword arguments)", "got: (1, {:optional_arg=>3, :required_arg=>2}) (options hash)")) ++ end.to fail_with(a_string_including(*messages)) + end + else + it "matches against a hash submitted as a positional argument and received as keyword arguments in Ruby 2.7 or before" do diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index 3fda021..8ef5746 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -3,7 +3,7 @@ %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} -%global baserelease 1 +%global baserelease 2 %global gem_name rspec-mocks @@ -23,6 +23,9 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{fullver}.gem # %%{SOURCE2} %%{name} %%{version} Source1: rubygem-%{gem_name}-%{version}-full.tar.gz Source2: rspec-related-create-full-tarball.sh +# https://github.com/rspec/rspec-mocks/pull/1597 +# support ruby3.4 formatting +Patch0: rspec-mocks-pr1597-ruby34-formatting.patch BuildRequires: rubygems-devel %if %{without bootstrap} @@ -60,6 +63,8 @@ gem unpack %{SOURCE0} sed -i cucumber.yml -e "s|~@wip|not @wip|" sed -i features/support/disallow_certain_apis.rb -e "s|~@allow-old-syntax|not @allow-old-syntax|" +%patch -P0 -p1 + gem specification %{SOURCE0} -l --ruby > %{gem_name}.gemspec %build @@ -118,6 +123,9 @@ cucumber %{gem_docdir} %changelog +* Wed Nov 06 2024 Mamoru TASAKA - 3.13.2-2 +- Backport upstream patch to support ruby34 formatting + * Thu Oct 03 2024 Mamoru TASAKA - 3.13.2-1 - 3.13.2 From c8bf8300ed40a7fb3f8375268bb59f3e3d92b2c8 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Sun, 29 Dec 2024 11:06:39 +0900 Subject: [PATCH 21/29] Coordinate with rspec-support change wrt ruby34 hash inspect support --- rspec-mocks-pr164-ruby34-hash-syntax.patch | 190 +++++++++++++++++++++ rubygem-rspec-mocks.spec | 9 +- 2 files changed, 198 insertions(+), 1 deletion(-) create mode 100644 rspec-mocks-pr164-ruby34-hash-syntax.patch diff --git a/rspec-mocks-pr164-ruby34-hash-syntax.patch b/rspec-mocks-pr164-ruby34-hash-syntax.patch new file mode 100644 index 0000000..2f5bec0 --- /dev/null +++ b/rspec-mocks-pr164-ruby34-hash-syntax.patch @@ -0,0 +1,190 @@ +From 9310b4b72e205c6352c4b30015a3b8f3d2fb02e8 Mon Sep 17 00:00:00 2001 +From: Jon Rowe +Date: Thu, 26 Dec 2024 11:06:37 +0000 +Subject: [PATCH 1/2] Format hashes in new {a: :b} format on Ruby 3.4 + +--- + .../step_definitions/additional_cli_steps.rb | 2 +- + .../rspec/mocks/argument_matchers_spec.rb | 24 ++++++++++++++++--- + rspec-mocks/spec/rspec/mocks/diffing_spec.rb | 17 +++++-------- + rspec-mocks/spec/rspec/mocks/double_spec.rb | 2 +- + .../spec/rspec/mocks/matchers/receive_spec.rb | 4 ++-- + .../expected_arg_verification_spec.rb | 2 +- + .../lib/rspec/support/object_formatter.rb | 2 ++ + .../spec/rspec/support/differ_spec.rb | 2 +- + .../rspec/support/object_formatter_spec.rb | 22 +++++++++++++++-- + 9 files changed, 55 insertions(+), 22 deletions(-) + +diff --git a/rspec-mocks/features/step_definitions/additional_cli_steps.rb b/rspec-mocks/features/step_definitions/additional_cli_steps.rb +index acf1117e0..9ccfac5b1 100644 +--- a/rspec-mocks/features/step_definitions/additional_cli_steps.rb ++++ b/rspec-mocks/features/step_definitions/additional_cli_steps.rb +@@ -27,7 +27,7 @@ + lines = table.raw.flatten.reject(&:empty?) + + if ignore_hash_syntax && RUBY_VERSION.to_f > 3.3 +- lines = lines.map { |line| line.gsub(/([^\s])=>/, '\1 => ') } ++ lines = lines.map { |line| line.gsub(/:(\w+)=>/, '\1: ') } + end + + expect(all_output).to match_table(lines) +diff --git a/rspec-mocks/spec/rspec/mocks/argument_matchers_spec.rb b/rspec-mocks/spec/rspec/mocks/argument_matchers_spec.rb +index 8f31d1786..4bffa727d 100644 +--- a/rspec-mocks/spec/rspec/mocks/argument_matchers_spec.rb ++++ b/rspec-mocks/spec/rspec/mocks/argument_matchers_spec.rb +@@ -431,7 +431,13 @@ def ==(other) + expect(a_double).to receive(:random_call).with(:a => "a", :b => "b") + expect do + a_double.random_call(opts) +- end.to fail_with(/expected: \(\{(:a\s*=>\s*\"a\", :b\s*=>\s*\"b\"|:b\s*=>\s*\"b\", :a\s*=>\s*\"a\")\}\)/) ++ end.to fail_with( ++ if RUBY_VERSION.to_f > 3.3 ++ /expected: \(\{a: \"a\", b: \"b\"\}\)/ ++ else ++ /expected: \(\{(:a\s*=>\s*\"a\", :b\s*=>\s*\"b\"|:b\s*=>\s*\"b\", :a\s*=>\s*\"a\")\}\)/ ++ end ++ ) + end + else + it "matches against a hash submitted as a positional argument and received as keyword arguments in Ruby 2.7 or before" do +@@ -445,14 +451,26 @@ def ==(other) + expect(a_double).to receive(:random_call).with(:a => "b", :c => "d") + expect do + a_double.random_call(:a => "b", :c => "e") +- end.to fail_with(/expected: \(\{(:a\s*=>\s*\"b\", :c\s*=>\s*\"d\"|:c\s*=>\s*\"d\", :a\s*=>\s*\"b\")\}\)/) ++ end.to fail_with( ++ if RUBY_VERSION.to_f > 3.3 ++ /expected: \(\{a: \"b\", c: \"d\"\}\)/ ++ else ++ /expected: \(\{(:a\s*=>\s*\"b\", :c\s*=>\s*\"d\"|:c\s*=>\s*\"d\", :a\s*=>\s*\"b\")\}\)/ ++ end ++ ) + end + + it "fails for a hash w/ wrong keys", :reset => true do + expect(a_double).to receive(:random_call).with(:a => "b", :c => "d") + expect do + a_double.random_call("a" => "b", "c" => "d") +- end.to fail_with(/expected: \(\{(:a\s*=>\s*\"b\", :c\s*=>\s*\"d\"|:c\s*=>\s*\"d\", :a\s*=>\s*\"b\")\}\)/) ++ end.to fail_with( ++ if RUBY_VERSION.to_f > 3.3 ++ /expected: \(\{a: \"b\", c: \"d\"\}\)/ ++ else ++ /expected: \(\{(:a\s*=>\s*\"b\", :c\s*=>\s*\"d\"|:c\s*=>\s*\"d\", :a\s*=>\s*\"b\")\}\)/ ++ end ++ ) + end + + it "matches a class against itself" do +diff --git a/rspec-mocks/spec/rspec/mocks/diffing_spec.rb b/rspec-mocks/spec/rspec/mocks/diffing_spec.rb +index f071cc1ec..b4492b4e8 100644 +--- a/rspec-mocks/spec/rspec/mocks/diffing_spec.rb ++++ b/rspec-mocks/spec/rspec/mocks/diffing_spec.rb +@@ -105,7 +105,7 @@ + " expected: ({:baz=>:quz, :foo=>:bar}) (keyword arguments)\n" \ + " got: ({:baz=>:quz, :foo=>:bar}) (options hash)" + +- message = message.gsub('=>', ' => ') if RUBY_VERSION.to_f > 3.3 ++ message = message.gsub(/:(\w+)=>/, '\1: ') if RUBY_VERSION.to_f > 3.3 + + with_unfulfilled_double do |d| + expect(d).to receive(:foo).with(**expected_hash) +@@ -126,7 +126,7 @@ + " expected: (:positional, {:keyword=>1}) (keyword arguments)\n" \ + " got: (:positional, {:keyword=>1}) (options hash)" + +- message = message.gsub('=>',' => ') if RUBY_VERSION.to_f > 3.3 ++ message = message.gsub(/:(\w+)=>/, '\1: ') if RUBY_VERSION.to_f > 3.3 + + expect { + options = { keyword: 1 } +@@ -155,7 +155,7 @@ + "-[#{expected_input.inspect}, {:one=>1}]\n" \ + "+[#{actual_input.inspect}, {:one=>1}]\n" + +- message = message.gsub('=>',' => ') if RUBY_VERSION.to_f > 3.3 ++ message = message.gsub(/:(\w+)=>/, '\1: ') if RUBY_VERSION.to_f > 3.3 + + expect { + options = { one: 1 } +@@ -187,7 +187,7 @@ + " expected: (:positional, {:baz=>:quz, :foo=>:bar}) (keyword arguments)\n" \ + " got: (:positional, {:baz=>:quz, :foo=>:bar}) (options hash)" + +- message.gsub!('=>',' => ') if RUBY_VERSION.to_f > 3.3 ++ message = message.gsub(/:(\w+)=>/, '\1: ') if RUBY_VERSION.to_f > 3.3 + + expect(d).to receive(:foo).with(:positional, **expected_hash) + expect { +@@ -203,7 +203,7 @@ + " expected: (:positional, {:keyword=>1}) (keyword arguments)\n" \ + " got: (:positional, {:keyword=>1}) (options hash)" + +- message.gsub!('=>',' => ') if RUBY_VERSION.to_f > 3.3 ++ message = message.gsub(/:(\w+)=>/, '\1: ') if RUBY_VERSION.to_f > 3.3 + + expect(d).to receive(:foo).with(:positional, keyword: 1) + expect { +@@ -231,7 +231,7 @@ + "-[#{expected_input.inspect}, {:one=>1}]\n" \ + "+[#{actual_input.inspect}, {:one=>1}]\n" + +- message = message.gsub('=>', ' => ') if RUBY_VERSION.to_f > 3.3 ++ message = message.gsub(/:(\w+)=>/, '\1: ') if RUBY_VERSION.to_f > 3.3 + + expect { + options = { one: 1 } +@@ -251,11 +251,6 @@ + def hash_regex_inspect(hash) + "\\{(#{hash.map { |key, value| "#{key.inspect}=>#{value.inspect}.*" }.join "|"}){#{hash.size}}\\}" + end +- elsif RUBY_VERSION.to_f > 3.3 +- # Ruby head / 3.4 is changing the hash syntax inspect, but we use PP when diffing which just spaces out hashrockets +- def hash_regex_inspect(hash) +- Regexp.escape("{#{hash.map { |key, value| "#{key.inspect} => #{value.inspect}"}.join(", ")}}") +- end + else + def hash_regex_inspect(hash) + Regexp.escape(hash.inspect) +diff --git a/rspec-mocks/spec/rspec/mocks/double_spec.rb b/rspec-mocks/spec/rspec/mocks/double_spec.rb +index ac65c590f..9738edfa7 100644 +--- a/rspec-mocks/spec/rspec/mocks/double_spec.rb ++++ b/rspec-mocks/spec/rspec/mocks/double_spec.rb +@@ -528,7 +528,7 @@ def initialize(amount, units) + it 'fails when calling yielding method with invalid kw args' do + message = + if RUBY_VERSION.to_f > 3.3 +- '# yielded |{:x => 1, :y => 2}| to block with optional keyword args (:x)' ++ '# yielded |{x: 1, y: 2}| to block with optional keyword args (:x)' + else + '# yielded |{:x=>1, :y=>2}| to block with optional keyword args (:x)' + end +diff --git a/rspec-mocks/spec/rspec/mocks/matchers/receive_spec.rb b/rspec-mocks/spec/rspec/mocks/matchers/receive_spec.rb +index 3e71bd289..307c86a6f 100644 +--- a/rspec-mocks/spec/rspec/mocks/matchers/receive_spec.rb ++++ b/rspec-mocks/spec/rspec/mocks/matchers/receive_spec.rb +@@ -141,8 +141,8 @@ def kw_args_method(a:, b:); end + + if RUBY_VERSION.to_f > 3.3 + expect(failure.message) +- .to include('expected: ({:a => 1, :b => 2}) (keyword arguments)') +- .and include('got: ({:a => 1, :b => 2}) (options hash)') ++ .to include('expected: ({a: 1, b: 2}) (keyword arguments)') ++ .and include('got: ({a: 1, b: 2}) (options hash)') + else + expect(failure.message) + .to include('expected: ({:a=>1, :b=>2}) (keyword arguments)') +diff --git a/rspec-mocks/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb b/rspec-mocks/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb +index a3f3d2034..48646a1e6 100644 +--- a/rspec-mocks/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb ++++ b/rspec-mocks/spec/rspec/mocks/verifying_doubles/expected_arg_verification_spec.rb +@@ -134,7 +134,7 @@ module Mocks + it "fails to match against a hash submitted as a positional argument and received as keyword arguments in Ruby 3.0 or later", :reset => true do + messages = + if RUBY_VERSION.to_f > 3.3 +- ["expected: (1, {:optional_arg => 3, :required_arg => 2}) (keyword arguments)", "got: (1, {:optional_arg => 3, :required_arg => 2}) (options hash)"] ++ ["expected: (1, {optional_arg: 3, required_arg: 2}) (keyword arguments)", "got: (1, {optional_arg: 3, required_arg: 2}) (options hash)"] + else + ["expected: (1, {:optional_arg=>3, :required_arg=>2}) (keyword arguments)", "got: (1, {:optional_arg=>3, :required_arg=>2}) (options hash)"] + end + diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index 8ef5746..961294b 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -3,7 +3,7 @@ %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} -%global baserelease 2 +%global baserelease 3 %global gem_name rspec-mocks @@ -26,6 +26,9 @@ Source2: rspec-related-create-full-tarball.sh # https://github.com/rspec/rspec-mocks/pull/1597 # support ruby3.4 formatting Patch0: rspec-mocks-pr1597-ruby34-formatting.patch +# https://github.com/rspec/rspec/pull/164 +# rspec-support side changed, rspec-mock need coordinating with the change +Patch1: rspec-mocks-pr164-ruby34-hash-syntax.patch BuildRequires: rubygems-devel %if %{without bootstrap} @@ -64,6 +67,7 @@ sed -i cucumber.yml -e "s|~@wip|not @wip|" sed -i features/support/disallow_certain_apis.rb -e "s|~@allow-old-syntax|not @allow-old-syntax|" %patch -P0 -p1 +%patch -P1 -p2 gem specification %{SOURCE0} -l --ruby > %{gem_name}.gemspec @@ -123,6 +127,9 @@ cucumber %{gem_docdir} %changelog +* Sun Dec 29 2024 Mamoru TASAKA - 3.13.2-3 +- Coordinate with rspec-support change wrt ruby34 hash inspect support + * Wed Nov 06 2024 Mamoru TASAKA - 3.13.2-2 - Backport upstream patch to support ruby34 formatting From f61b7f5c690f66f669e7226568d8fc4fe0ed3437 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 18 Jan 2025 23:57:55 +0000 Subject: [PATCH 22/29] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- rubygem-rspec-mocks.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index 961294b..91cc323 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -3,7 +3,7 @@ %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} -%global baserelease 3 +%global baserelease 4 %global gem_name rspec-mocks @@ -127,6 +127,9 @@ cucumber %{gem_docdir} %changelog +* Sat Jan 18 2025 Fedora Release Engineering - 3.13.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Sun Dec 29 2024 Mamoru TASAKA - 3.13.2-3 - Coordinate with rspec-support change wrt ruby34 hash inspect support From c90968f649ccf7cfbe8962ba92d1e33f7649e0fe Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Thu, 15 May 2025 14:50:56 +0900 Subject: [PATCH 23/29] 3.13.4 --- rspec-related-create-full-tarball.sh | 7 +++---- rubygem-rspec-mocks.spec | 16 +++++----------- sources | 4 ++-- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/rspec-related-create-full-tarball.sh b/rspec-related-create-full-tarball.sh index a847c6c..c0ba6bf 100644 --- a/rspec-related-create-full-tarball.sh +++ b/rspec-related-create-full-tarball.sh @@ -14,10 +14,9 @@ CURRDIR=$(pwd) TMPDIRPATH=$(mktemp -d /var/tmp/rspec-tar-XXXXXX) pushd $TMPDIRPATH -git clone https://github.com/rspec/$1.git -pushd $1 -git reset --hard v$2 -popd +git clone https://github.com/rspec/rspec.git +pushd rspec +git reset --hard $1-v$2 ln -sf $1 $1-$2 tar czf ${CURRDIR}/rubygem-$1-$2-full.tar.gz $1-$2/./ diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index 91cc323..e6a3a93 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -1,9 +1,9 @@ -%global majorver 3.13.2 +%global majorver 3.13.4 #%%global preminorver .rc6 %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} -%global baserelease 4 +%global baserelease 1 %global gem_name rspec-mocks @@ -23,12 +23,6 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{fullver}.gem # %%{SOURCE2} %%{name} %%{version} Source1: rubygem-%{gem_name}-%{version}-full.tar.gz Source2: rspec-related-create-full-tarball.sh -# https://github.com/rspec/rspec-mocks/pull/1597 -# support ruby3.4 formatting -Patch0: rspec-mocks-pr1597-ruby34-formatting.patch -# https://github.com/rspec/rspec/pull/164 -# rspec-support side changed, rspec-mock need coordinating with the change -Patch1: rspec-mocks-pr164-ruby34-hash-syntax.patch BuildRequires: rubygems-devel %if %{without bootstrap} @@ -66,9 +60,6 @@ gem unpack %{SOURCE0} sed -i cucumber.yml -e "s|~@wip|not @wip|" sed -i features/support/disallow_certain_apis.rb -e "s|~@allow-old-syntax|not @allow-old-syntax|" -%patch -P0 -p1 -%patch -P1 -p2 - gem specification %{SOURCE0} -l --ruby > %{gem_name}.gemspec %build @@ -127,6 +118,9 @@ cucumber %{gem_docdir} %changelog +* Thu May 15 2025 Mamoru TASAKA - 3.13.4-1 +- 3.13.4 + * Sat Jan 18 2025 Fedora Release Engineering - 3.13.2-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild diff --git a/sources b/sources index b62a81b..025ae7e 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rspec-mocks-3.13.2.gem) = 3284411d5f9c3b10aca0ca41bfeec4ec423b1d2effb1942a36ff61c741ff8b1281ae69d46086881f99fc3e70522cf6a31805e980fe270e35cc35c6d8376c9152 -SHA512 (rubygem-rspec-mocks-3.13.2-full.tar.gz) = 79a22d5356247e4d563868589f512018f51a235aafa9d001d81673c73bc1d0a04be7c4770518744f77dfb4e7f726b5c037384a5f14cd853202466b68e4398e9c +SHA512 (rspec-mocks-3.13.4.gem) = 3d8253db68c821398018de027d1e61add5616d2e8eaeb4d224e28d3693bdb96b9af9ae8c0357438a54053240adff6975704a4576f491d087182d6be7efc2281b +SHA512 (rubygem-rspec-mocks-3.13.4-full.tar.gz) = 4217cf0e88067abd2725d4ff5c1c5ab07a6b9b4216d32960fe069596cc6f148c59c0f21a3abee07d37615833c7906bca3355200059597ae46c617e7af7987f9c From e8c6bb2889d9519081a88ca0fa79c8aeffff7c2f Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Thu, 29 May 2025 17:33:05 +0900 Subject: [PATCH 24/29] 3.13.5 --- rubygem-rspec-mocks.spec | 7 +++++-- sources | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index e6a3a93..eb3b5e6 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -1,4 +1,4 @@ -%global majorver 3.13.4 +%global majorver 3.13.5 #%%global preminorver .rc6 %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} @@ -18,7 +18,7 @@ Release: %{?preminorver:0.}%{baserelease}%{?preminorver:%{rpmminorver}}%{?dist} # SPDX confirmed License: MIT -URL: http://github.com/rspec/rspec-mocks +URL: https://rspec.info Source0: https://rubygems.org/gems/%{gem_name}-%{fullver}.gem # %%{SOURCE2} %%{name} %%{version} Source1: rubygem-%{gem_name}-%{version}-full.tar.gz @@ -118,6 +118,9 @@ cucumber %{gem_docdir} %changelog +* Thu May 29 2025 Mamoru TASAKA - 3.13.5-1 +- 3.13.5 + * Thu May 15 2025 Mamoru TASAKA - 3.13.4-1 - 3.13.4 diff --git a/sources b/sources index 025ae7e..3615ca4 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rspec-mocks-3.13.4.gem) = 3d8253db68c821398018de027d1e61add5616d2e8eaeb4d224e28d3693bdb96b9af9ae8c0357438a54053240adff6975704a4576f491d087182d6be7efc2281b -SHA512 (rubygem-rspec-mocks-3.13.4-full.tar.gz) = 4217cf0e88067abd2725d4ff5c1c5ab07a6b9b4216d32960fe069596cc6f148c59c0f21a3abee07d37615833c7906bca3355200059597ae46c617e7af7987f9c +SHA512 (rspec-mocks-3.13.5.gem) = 130e1c9e71a5d8d863a4a6d1b394f4eee680642810fcdd11c49cbfc6dc1adc6d6b9fdc492b2a2975d0900bec00e12f18fbe2b86b9d5a27bb48f5d3dbf154f9dc +SHA512 (rubygem-rspec-mocks-3.13.5-full.tar.gz) = 1496caf9765ffb71a9a9c930269c2980806004fe4e9edfb4326631da39de5b98532a91c6739ae041f7763c06b8faf1f0af3995bb747a58254f35264de72f4e4c From ea7c65f9470c4df84f36d91e9200b5f2f54eb4d0 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 12:45:43 +0000 Subject: [PATCH 25/29] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- rubygem-rspec-mocks.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index eb3b5e6..c60959e 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -3,7 +3,7 @@ %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} -%global baserelease 1 +%global baserelease 2 %global gem_name rspec-mocks @@ -118,6 +118,9 @@ cucumber %{gem_docdir} %changelog +* Fri Jul 25 2025 Fedora Release Engineering - 3.13.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Thu May 29 2025 Mamoru TASAKA - 3.13.5-1 - 3.13.5 From 9630dad5dfc370d7fb3eac0811c583da2ed87d83 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Fri, 17 Oct 2025 16:09:32 +0900 Subject: [PATCH 26/29] 3.13.6 --- rubygem-rspec-mocks.spec | 7 +++++-- sources | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index c60959e..3f1ffe2 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -1,9 +1,9 @@ -%global majorver 3.13.5 +%global majorver 3.13.6 #%%global preminorver .rc6 %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} -%global baserelease 2 +%global baserelease 1 %global gem_name rspec-mocks @@ -118,6 +118,9 @@ cucumber %{gem_docdir} %changelog +* Fri Oct 17 2025 Mamoru TASAKA - 3.13.6-1 +- 3.13.6 + * Fri Jul 25 2025 Fedora Release Engineering - 3.13.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild diff --git a/sources b/sources index 3615ca4..2f17ca9 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rspec-mocks-3.13.5.gem) = 130e1c9e71a5d8d863a4a6d1b394f4eee680642810fcdd11c49cbfc6dc1adc6d6b9fdc492b2a2975d0900bec00e12f18fbe2b86b9d5a27bb48f5d3dbf154f9dc -SHA512 (rubygem-rspec-mocks-3.13.5-full.tar.gz) = 1496caf9765ffb71a9a9c930269c2980806004fe4e9edfb4326631da39de5b98532a91c6739ae041f7763c06b8faf1f0af3995bb747a58254f35264de72f4e4c +SHA512 (rspec-mocks-3.13.6.gem) = 768199567b3220707d0294afb9d2e56a6e95e705f58ecae87cc1070de317d5883c41722bcc0f8445db582b341234553b1e3a583a66d5e18c81a5e1b23b5d8d70 +SHA512 (rubygem-rspec-mocks-3.13.6-full.tar.gz) = 47da2ab21faffa2e382c699580243ec1c3e0b8c7ba5885efc605ab777ebca28d4429b6e6988b4f64fddceb0230759a764dc0c8bf37d226c876b42120c21415d0 From a36833c28caf52e202274921e4839559a8668073 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Mon, 24 Nov 2025 10:18:24 +0900 Subject: [PATCH 27/29] 3.13.7 --- rubygem-rspec-mocks.spec | 7 +++++-- sources | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index 3f1ffe2..7a9a72f 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -1,4 +1,4 @@ -%global majorver 3.13.6 +%global majorver 3.13.7 #%%global preminorver .rc6 %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} @@ -7,7 +7,7 @@ %global gem_name rspec-mocks -%bcond_with bootstrap +%bcond_without bootstrap %undefine __brp_mangle_shebangs @@ -118,6 +118,9 @@ cucumber %{gem_docdir} %changelog +* Mon Nov 24 2025 Mamoru TASAKA - 3.13.7-1 +- 3.13.7 + * Fri Oct 17 2025 Mamoru TASAKA - 3.13.6-1 - 3.13.6 diff --git a/sources b/sources index 2f17ca9..38528a1 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (rspec-mocks-3.13.6.gem) = 768199567b3220707d0294afb9d2e56a6e95e705f58ecae87cc1070de317d5883c41722bcc0f8445db582b341234553b1e3a583a66d5e18c81a5e1b23b5d8d70 -SHA512 (rubygem-rspec-mocks-3.13.6-full.tar.gz) = 47da2ab21faffa2e382c699580243ec1c3e0b8c7ba5885efc605ab777ebca28d4429b6e6988b4f64fddceb0230759a764dc0c8bf37d226c876b42120c21415d0 +SHA512 (rspec-mocks-3.13.7.gem) = fa30824f1d7ab82e2c0d1cde1f076cb84b9a9e1e9e7292e33bcfda934468a50f2b59a1dc539137be14ad5b86465ed6fa12c32af2e3a79992c3ce5d278072861c +SHA512 (rubygem-rspec-mocks-3.13.7-full.tar.gz) = 7666b07e6b9806e36d53ede810c6efc0ceb57bc554c96e0fdf44efbfd9dd027a8e999ce942d20bf46f93f93bfae1a88c7ffd0bfbf2cdf08601093a98218a059a From 84c1aaf5666d21de8361a7eee2ad00296e412506 Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Mon, 24 Nov 2025 10:26:50 +0900 Subject: [PATCH 28/29] kill bootstrap --- rubygem-rspec-mocks.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index 7a9a72f..46dc520 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -7,7 +7,7 @@ %global gem_name rspec-mocks -%bcond_without bootstrap +%bcond_with bootstrap %undefine __brp_mangle_shebangs From 18f1a225467f551fbb235963662d048c53befa4d Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Tue, 2 Dec 2025 16:42:08 +0900 Subject: [PATCH 29/29] Backport upstream patch to skip mock for Kernel#inspect on ruby4_0 --- ...-pr282-skip-mock-for-ruby4_0-inspect.patch | 35 +++++++++++++++++++ rubygem-rspec-mocks.spec | 9 ++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 rspec-mocks-pr282-skip-mock-for-ruby4_0-inspect.patch diff --git a/rspec-mocks-pr282-skip-mock-for-ruby4_0-inspect.patch b/rspec-mocks-pr282-skip-mock-for-ruby4_0-inspect.patch new file mode 100644 index 0000000..d1c309b --- /dev/null +++ b/rspec-mocks-pr282-skip-mock-for-ruby4_0-inspect.patch @@ -0,0 +1,35 @@ +From 939c4799993b7ff7e524fac701ae6490772ca6de Mon Sep 17 00:00:00 2001 +From: Jon Rowe +Date: Mon, 1 Dec 2025 14:08:25 +0000 +Subject: [PATCH] Skip mock for calls to `:respond_to?` from `Kernel#inspect` + +--- + rspec-mocks/lib/rspec/mocks/method_double.rb | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +diff --git a/rspec-mocks/lib/rspec/mocks/method_double.rb b/rspec-mocks/lib/rspec/mocks/method_double.rb +index e2edb1e21..3276c49a5 100644 +--- a/rspec-mocks/lib/rspec/mocks/method_double.rb ++++ b/rspec-mocks/lib/rspec/mocks/method_double.rb +@@ -68,8 +68,19 @@ def define_proxy_method + + save_original_implementation_callable! + definition_target.class_exec(self, method_name, @original_visibility || visibility) do |method_double, method_name, visibility| +- define_method(method_name) do |*args, &block| +- method_double.proxy_method_invoked(self, *args, &block) ++ if RUBY_VERSION.to_f > 3 && method_name == :respond_to? ++ define_method(method_name) do |*args, &block| ++ # This is a work around for a respond_to? check within kernel_inspect ++ if caller_locations[0].label == "Kernel#inspect" ++ super(*args, &block) ++ else ++ method_double.proxy_method_invoked(self, *args, &block) ++ end ++ end ++ else ++ define_method(method_name) do |*args, &block| ++ method_double.proxy_method_invoked(self, *args, &block) ++ end + end + # This can't be `if respond_to?(:ruby2_keywords, true)`, + # see https://github.com/rspec/rspec-mocks/pull/1385#issuecomment-755340298 diff --git a/rubygem-rspec-mocks.spec b/rubygem-rspec-mocks.spec index 46dc520..2a2f1da 100644 --- a/rubygem-rspec-mocks.spec +++ b/rubygem-rspec-mocks.spec @@ -3,7 +3,7 @@ %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} -%global baserelease 1 +%global baserelease 2 %global gem_name rspec-mocks @@ -23,6 +23,9 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{fullver}.gem # %%{SOURCE2} %%{name} %%{version} Source1: rubygem-%{gem_name}-%{version}-full.tar.gz Source2: rspec-related-create-full-tarball.sh +# https://github.com/rspec/rspec/pull/282/commits/939c4799993b7ff7e524fac701ae6490772ca6de +# Skip mock for ruby4_0 Kernel#inspect +Patch0: rspec-mocks-pr282-skip-mock-for-ruby4_0-inspect.patch BuildRequires: rubygems-devel %if %{without bootstrap} @@ -55,6 +58,7 @@ This package contains documentation for %{name}. gem unpack %{SOURCE0} %setup -q -D -T -n %{gem_name}-%{version} -b 1 +%patch -P0 -p2 # Cucumber 7 syntax change sed -i cucumber.yml -e "s|~@wip|not @wip|" @@ -118,6 +122,9 @@ cucumber %{gem_docdir} %changelog +* Tue Dec 02 2025 Mamoru TASAKA - 3.13.7-2 +- Backport upstream patch to skip mock for Kernel#inspect on ruby4_0 + * Mon Nov 24 2025 Mamoru TASAKA - 3.13.7-1 - 3.13.7