From fd39c3dd7ad34432c103e2f6c533da0af3dfef18 Mon Sep 17 00:00:00 2001 From: Jarek Prokop Date: Tue, 30 Jan 2024 09:04:38 +0100 Subject: [PATCH] Fix "undefined method `=~' for class ..." in test suite. Fix "Undefined method `=~'" exception coming from RHEL 8's rubygem-rspec 3.7.0. RSpec 3.7.0 uses Object#=~, however the method was removed in Ruby 3.2. It is fixed in newer upstream RSpec. https://github.com/rspec/rspec-core/pull/2582 https://bugs.ruby-lang.org/issues/15231 Related: RHEL-17090 --- rubygem-pg.spec | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rubygem-pg.spec b/rubygem-pg.spec index 3a1816c..9b1f9c1 100644 --- a/rubygem-pg.spec +++ b/rubygem-pg.spec @@ -86,6 +86,13 @@ rm -rf %{buildroot}%{gem_instdir}/ext/ pushd .%{gem_instdir} ln -s %{_builddir}/spec . +# Fix "Undefined method `=~'" exception coming from RHEL 8's rubygem-rspec 3.7.0. +# RSpec 3.7.0 uses Object#=~, however the method was removed in Ruby 3.2. +# It is fixed in newer upstream RSpec. +# https://github.com/rspec/rspec-core/pull/2582 +# https://bugs.ruby-lang.org/issues/15231 +sed -i -r 's/describe ([A-Za-z:]+) do/describe "\1" do/g' spec/pg/type_spec.rb + # Set --verbose to show detail log by $VERBOSE. # See https://github.com/ged/ruby-pg/blob/master/spec/helpers.rb $VERBOSE # Assign a random port to consider a case of multi builds in parallel in a host.