Compare commits
5 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
090bd40846 | ||
|
|
d6a2f5797c | ||
|
|
15b63302db | ||
|
|
c7ab3db585 | ||
|
|
0b4751d6d0 |
4 changed files with 44 additions and 100 deletions
20
rubygem-rspec-support-3.13.3-diff_spec-format-revert.patch
Normal file
20
rubygem-rspec-support-3.13.3-diff_spec-format-revert.patch
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
--- rspec-support-3.13.3/spec/rspec/support/differ_spec.rb.orig 2025-05-15 11:05:59.000000000 +0900
|
||||
+++ rspec-support-3.13.3/spec/rspec/support/differ_spec.rb 2025-05-15 11:36:03.054513436 +0900
|
||||
@@ -200,7 +200,7 @@ module RSpec
|
||||
|
||||
expected_diff = dedent(<<-"EOD")
|
||||
|
|
||||
- |@@ #{one_line_header(5)} @@
|
||||
+ |@@ -1,5 +1,5 @@
|
||||
| <Animal
|
||||
| name=bob,
|
||||
|- species=tortoise
|
||||
@@ -427,7 +427,7 @@ module RSpec
|
||||
|
||||
expected_diff = dedent(<<-"EOD")
|
||||
|
|
||||
- |@@ #{one_line_header(3)} @@
|
||||
+ |@@ -1,3 +1,3 @@
|
||||
| this is:
|
||||
|- another string
|
||||
|+ one string
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
From 9310b4b72e205c6352c4b30015a3b8f3d2fb02e8 Mon Sep 17 00:00:00 2001
|
||||
From: Jon Rowe <hello@jonrowe.co.uk>
|
||||
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-support/lib/rspec/support/object_formatter.rb b/rspec-support/lib/rspec/support/object_formatter.rb
|
||||
index a3d5a11cb..d464f1b3c 100644
|
||||
--- a/rspec-support/lib/rspec/support/object_formatter.rb
|
||||
+++ b/rspec-support/lib/rspec/support/object_formatter.rb
|
||||
@@ -61,6 +61,8 @@ def prepare_for_inspection(object)
|
||||
prepare_array(object)
|
||||
when Hash
|
||||
prepare_hash(object)
|
||||
+ when Symbol
|
||||
+ object
|
||||
else
|
||||
inspector_class = INSPECTOR_CLASSES.find { |inspector| inspector.can_inspect?(object) }
|
||||
inspector_class.new(object, self)
|
||||
diff --git a/rspec-support/spec/rspec/support/differ_spec.rb b/rspec-support/spec/rspec/support/differ_spec.rb
|
||||
index bcfd9744a..18f6aefc4 100644
|
||||
--- a/rspec-support/spec/rspec/support/differ_spec.rb
|
||||
+++ b/rspec-support/spec/rspec/support/differ_spec.rb
|
||||
@@ -308,7 +308,7 @@ def inspect; "<BrokenObject>"; end
|
||||
|
|
||||
EOD
|
||||
|
||||
- expected_diff.gsub!('=>',' => ') if RUBY_VERSION.to_f > 3.3
|
||||
+ expected_diff.gsub!(/:(\w+)=>/,'\1: ') if RUBY_VERSION.to_f > 3.3
|
||||
|
||||
diff = differ.diff(expected,actual)
|
||||
expect(diff).to be_diffed_as(expected_diff)
|
||||
diff --git a/rspec-support/spec/rspec/support/object_formatter_spec.rb b/rspec-support/spec/rspec/support/object_formatter_spec.rb
|
||||
index 68c48a549..3bbe20390 100644
|
||||
--- a/rspec-support/spec/rspec/support/object_formatter_spec.rb
|
||||
+++ b/rspec-support/spec/rspec/support/object_formatter_spec.rb
|
||||
@@ -17,6 +17,19 @@ module Support
|
||||
end
|
||||
end
|
||||
|
||||
+ context "with an array containing a hash", :aggregate_failures do
|
||||
+ it "formats the output the same as if it was inspected" do
|
||||
+ formatted = ObjectFormatter.format([{ :a => :b }])
|
||||
+ expect(formatted).to eq(
|
||||
+ if RUBY_VERSION.to_f > 3.3
|
||||
+ "[{a: :b}]"
|
||||
+ else
|
||||
+ "[{:a=>:b}]"
|
||||
+ end
|
||||
+ )
|
||||
+ end
|
||||
+ end
|
||||
+
|
||||
context "with a hash object containing other objects for which we have custom formatting" do
|
||||
let(:time) { Time.utc(1969, 12, 31, 19, 01, 40, 101) }
|
||||
let(:formatted_time) { ObjectFormatter.format(time) }
|
||||
@@ -37,7 +50,12 @@ module Support
|
||||
unless RUBY_VERSION == '1.8.7' # We can't count on the ordering of the hash on 1.8.7...
|
||||
context 'with a hash object' do
|
||||
let(:input) { { :c => "ccc", :a => "aaa", "b" => 'bbb' } }
|
||||
- let(:expected) { '{:a=>"aaa", "b"=>"bbb", :c=>"ccc"}' }
|
||||
+
|
||||
+ if RUBY_VERSION.to_f > 3.3
|
||||
+ let(:expected) { '{a: "aaa", "b"=>"bbb", c: "ccc"}' }
|
||||
+ else
|
||||
+ let(:expected) { '{:a=>"aaa", "b"=>"bbb", :c=>"ccc"}' }
|
||||
+ end
|
||||
|
||||
it 'sorts keys to ensure objects are always displayed the same way' do
|
||||
formatted = ObjectFormatter.format(input)
|
||||
@@ -375,7 +393,7 @@ def inspect
|
||||
|
||||
if RUBY_VERSION.to_f > 3.3
|
||||
def eq_hash_syntax(string)
|
||||
- eq string.gsub('=>', ' => ')
|
||||
+ eq string.gsub(/:(\w+)=>/, '\1: ').gsub('=>', ' => ')
|
||||
end
|
||||
else
|
||||
def eq_hash_syntax(string)
|
||||
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
%global gem_name rspec-support
|
||||
|
||||
%global mainver 3.13.2
|
||||
%global mainver 3.13.6
|
||||
%undefine prever
|
||||
|
||||
%global baserelease 3
|
||||
%global baserelease 1
|
||||
%global prerpmver %(echo "%{?prever}" | sed -e 's|\\.||g')
|
||||
|
||||
%bcond_with bootstrap
|
||||
|
|
@ -17,14 +17,14 @@ Release: %{?prever:0.}%{baserelease}%{?prever:.%{prerpmver}}%{?dist}
|
|||
Summary: Common functionality to Rspec series
|
||||
# SPDX confirmed
|
||||
License: MIT
|
||||
URL: https://github.com/rspec/rspec-support
|
||||
URL: https://rspec.info
|
||||
Source0: https://rubygems.org/gems/%{gem_name}-%{mainver}%{?prever}.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/164
|
||||
# Support ruby34 Hash#inspect syntax
|
||||
Patch0: rubygem-rspec-support-pr164-ruby34-hash-syntax.patch
|
||||
# Workaround tests wrt diff/lcs diff format
|
||||
# Partially revert 3.13.2 -> 3.13.3 change
|
||||
Patch0: rubygem-rspec-support-3.13.3-diff_spec-format-revert.patch
|
||||
Patch100: rubygem-rspec-support-3.2.1-callerfilter-searchpath-regex.patch
|
||||
|
||||
#BuildRequires: ruby(release)
|
||||
|
|
@ -61,7 +61,7 @@ Documentation for %{name}
|
|||
%setup -q -T -n %{gem_name}-%{version} -b 1
|
||||
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
|
||||
|
||||
%patch -P0 -p2
|
||||
%patch -P0 -p1
|
||||
%patch -P100 -p1
|
||||
|
||||
%build
|
||||
|
|
@ -110,6 +110,21 @@ rspec spec/ || rspec --tag ~broken
|
|||
%doc %{gem_docdir}
|
||||
|
||||
%changelog
|
||||
* Wed Sep 17 2025 Mamoru TASAKA <mtasaka@fedoraproject.org> - 3.13.6-1
|
||||
- 3.13.6
|
||||
|
||||
* Tue Aug 19 2025 Mamoru TASAKA <mtasaka@fedoraproject.org> - 3.13.5-1
|
||||
- 3.13.5
|
||||
|
||||
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 3.13.4-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
|
||||
|
||||
* Thu May 29 2025 Mamoru TASAKA <mtasaka@fedoraproject.org> - 3.13.4-1
|
||||
- 3.13.4
|
||||
|
||||
* Thu May 15 2025 Mamoru TASAKA <mtasaka@fedoraproject.org> - 3.13.3-1
|
||||
- 3.13.3
|
||||
|
||||
* Sat Jan 18 2025 Fedora Release Engineering <releng@fedoraproject.org> - 3.13.2-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
|
||||
|
||||
|
|
|
|||
4
sources
4
sources
|
|
@ -1,2 +1,2 @@
|
|||
SHA512 (rspec-support-3.13.2.gem) = bf287156bc659f0f1c0198a4c1af577b01693484fca99c8a6bd6703da87cd021772bf18a02e886d29435a3793165cc7d5de3b485031aacf33b2cdd97b9669bbe
|
||||
SHA512 (rubygem-rspec-support-3.13.2-full.tar.gz) = be39887bc7b5ece60f3c811c0002a1d92fb31dcfdfcd38c3e937e551591834f79094ceef31c2104bc7a6735112b052c958ccced9b2e9a70810e41bcf9907eeda
|
||||
SHA512 (rubygem-rspec-support-3.13.6-full.tar.gz) = 09387dd39649d47bc3b859251e428808e06b1d2e6bc13d38f2b2da9241e1c937c71992f4b042053729d64af535fd6a6931d73b6d4f454c35eceae037839fa77d
|
||||
SHA512 (rspec-support-3.13.6.gem) = 7a07e6233e59da5bf9b1347de3e56330b02906cec8d05d619b1ff5f802f98cdf1194e63c01f4a3f5ac0bc68b59794edeaf4dc91cab37b563d57be82543e7df12
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue