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
This commit is contained in:
Jarek Prokop 2024-01-30 09:04:38 +01:00
parent 043f03cfa9
commit fd39c3dd7a

View File

@ -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.