diff --git a/rspec-expectations-pr282-ruby4_0-source_location.patch b/rspec-expectations-pr282-ruby4_0-source_location.patch new file mode 100644 index 0000000..19483fc --- /dev/null +++ b/rspec-expectations-pr282-ruby4_0-source_location.patch @@ -0,0 +1,25 @@ +From 1c20fa80772ca7a1ed0512056ce7cd6a94f8e68d Mon Sep 17 00:00:00 2001 +From: Jon Rowe +Date: Fri, 28 Nov 2025 10:59:10 +0000 +Subject: [PATCH] Cope with the changes to block source_location in Ruby 4 + +--- + rspec-core/lib/rspec/core/hooks.rb | 2 +- + rspec-core/lib/rspec/core/metadata.rb | 2 +- + rspec-core/lib/rspec/core/shared_example_group.rb | 2 +- + .../lib/rspec/expectations/block_snippet_extractor.rb | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/rspec-expectations/lib/rspec/expectations/block_snippet_extractor.rb b/rspec-expectations/lib/rspec/expectations/block_snippet_extractor.rb +index 5c66ac639..24dbaf88e 100644 +--- a/rspec-expectations/lib/rspec/expectations/block_snippet_extractor.rb ++++ b/rspec-expectations/lib/rspec/expectations/block_snippet_extractor.rb +@@ -62,7 +62,7 @@ def file_path + end + + def beginning_line_number +- source_location.last ++ source_location[1] + end + + def source_location diff --git a/rubygem-rspec-expectations.spec b/rubygem-rspec-expectations.spec index 1ef36a7..63bcd3c 100644 --- a/rubygem-rspec-expectations.spec +++ b/rubygem-rspec-expectations.spec @@ -3,7 +3,7 @@ %global rpmminorver .%(echo %preminorver | sed -e 's|^\\.\\.*||') %global fullver %{majorver}%{?preminorver} -%global baserelease 2 +%global baserelease 4 %global gem_name rspec-expectations @@ -26,6 +26,9 @@ Source2: rspec-related-create-full-tarball.sh # Workaround tests wrt diff/lcs diff format # Partially revert 3.13.3 -> 3.13.4 change Patch0: rubygem-rspec-expectations-3.13.4-diff_spec-format-revert.patch +# https://github.com/rspec/rspec/pull/282/commits/1c20fa80772ca7a1ed0512056ce7cd6a94f8e68d +# Support ruby4_0 source_location behavior change +Patch1: rspec-expectations-pr282-ruby4_0-source_location.patch #BuildRequires: ruby(release) BuildRequires: rubygems-devel @@ -59,6 +62,7 @@ This package contains documentation for %{name}. %setup -q -T -n %{gem_name}-%{version} -b 1 %patch -P0 -p1 +%patch -P1 -p2 gem specification %{SOURCE0} -l --ruby > %{gem_name}.gemspec @@ -89,6 +93,13 @@ rspec spec/ exit 0 %endif +# Fix minitest 6 compatibility +# Behavior changed on: https://github.com/minitest/minitest/commit/2572c78420af73dbe9b202d535a1474405a32173 +if ( ruby -e 'require "minitest" ; exit Minitest::VERSION >= "6"' ) ; then + sed -i features/test_frameworks/minitest.feature \ + -e 's|9 runs, 10 assertions, 5 failures, 0 errors|9 runs, 11 assertions, 5 failures, 0 errors|' +fi + # Skip one failing scenario, needs investigating... sed -i features/built_in_matchers/include.feature -e '\@skip-on-fedora@d' sed -i features/built_in_matchers/include.feature -e 's|^\([ \t]*\)\(Scenario: counts usage.*\)|\1@skip-on-fedora\n\1\2|' @@ -114,6 +125,12 @@ cucumber \ %{gem_docdir} %changelog +* Thu Jan 01 2026 Mamoru TASAKA - 3.13.5-4 +- Fix compatibility for minitest 6 + +* Tue Dec 02 2025 Mamoru TASAKA - 3.13.5-3 +- Backport upstream patch to support ruby4_0 source_location behavior change + * Fri Jul 25 2025 Fedora Release Engineering - 3.13.5-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild