diff --git a/ruby-bundler-2.4.0-bundle-update-bundler-test-in-ruby.patch b/ruby-bundler-2.4.0-bundle-update-bundler-test-in-ruby.patch new file mode 100644 index 0000000..b208537 --- /dev/null +++ b/ruby-bundler-2.4.0-bundle-update-bundler-test-in-ruby.patch @@ -0,0 +1,31 @@ +From bfa2f72cfa3bfde34049d26dcb24976316074ad7 Mon Sep 17 00:00:00 2001 +From: Jun Aruga +Date: Mon, 21 Mar 2022 15:36:51 +0100 +Subject: [PATCH] Fix a test for `bin/bundle update --bundler` to pass on + ruby/ruby. + +Consider the case that the latest Bundler version on RubyGems is higher than +the `system_bundler_version` (= `Bundler::VERSION`) in `make test-bundler` on +ruby/ruby. + +See . +--- + spec/bundler/commands/binstubs_spec.rb | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/spec/bundler/commands/binstubs_spec.rb b/spec/bundler/commands/binstubs_spec.rb +index 198226207bc..2634f43417c 100644 +--- a/spec/bundler/commands/binstubs_spec.rb ++++ b/spec/bundler/commands/binstubs_spec.rb +@@ -226,7 +226,10 @@ + + it "calls through to the latest bundler version" do + sys_exec "bin/bundle update --bundler", :env => { "DEBUG" => "1" } +- expect(out).to include %(Using bundler #{system_bundler_version}\n) ++ using_bundler_line = /Using bundler ([\w\.]+)\n/.match(out) ++ expect(using_bundler_line).to_not be_nil ++ latest_version = using_bundler_line[1] ++ expect(Gem::Version.new(latest_version)).to be >= Gem::Version.new(system_bundler_version) + end + + it "calls through to the explicit bundler version" do diff --git a/ruby.spec b/ruby.spec index b44669b..7e37172 100644 --- a/ruby.spec +++ b/ruby.spec @@ -85,6 +85,8 @@ %bcond_without gmp %bcond_without hostname %bcond_without systemtap +# Enable test when building on local. +%bcond_with bundler_tests %if 0%{?fedora} %bcond_without hardening_test @@ -161,6 +163,10 @@ Patch7: ruby-3.1.0-Don-t-query-RubyVM-FrozenCore-for-class-path.patch # Avoid possible timeout errors in TestBugReporter#test_bug_reporter_add. # https://bugs.ruby-lang.org/issues/16492 Patch19: ruby-2.7.1-Timeout-the-test_bug_reporter_add-witout-raising-err.patch +# Fix a test for `bin/bundle update --bundler` in `make test-bundler`. +# https://bugs.ruby-lang.org/issues/18643 +# https://github.com/rubygems/rubygems/commit/bfa2f72cfa3bfde34049d26dcb24976316074ad7 +Patch20: ruby-bundler-2.4.0-bundle-update-bundler-test-in-ruby.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Suggests: rubypick @@ -186,6 +192,8 @@ BuildRequires: multilib-rpm-config BuildRequires: gcc BuildRequires: make BuildRequires: zlib-devel +# The bundler/spec/runtime/setup_spec.rb requires the command `man`. +%{?with_bundler_tests:BuildRequires: %{_bindir}/man} # This package provides %%{_bindir}/ruby-mri therefore it is marked by this # virtual provide. It can be installed as dependency of rubypick. @@ -623,6 +631,7 @@ rm -rf ext/fiddle/libffi* %patch6 -p1 %patch7 -p1 %patch19 -p1 +%patch20 -p1 # Provide an example of usage of the tapset: cp -a %{SOURCE3} . @@ -938,6 +947,8 @@ mv test/fiddle/test_import.rb{,.disable} %{?test_timeout_scale:RUBY_TEST_TIMEOUT_SCALE="%{test_timeout_scale}"} \ make check TESTS="-v $DISABLE_TESTS" MSPECOPT="-fs $MSPECOPTS" +%{?with_bundler_tests:make test-bundler-parallel} + %files %license BSDL %license COPYING