2fb58f
From bfa2f72cfa3bfde34049d26dcb24976316074ad7 Mon Sep 17 00:00:00 2001
2fb58f
From: Jun Aruga <jaruga@redhat.com>
2fb58f
Date: Mon, 21 Mar 2022 15:36:51 +0100
2fb58f
Subject: [PATCH] Fix a test for `bin/bundle update --bundler` to pass on
2fb58f
 ruby/ruby.
2fb58f
2fb58f
Consider the case that the latest Bundler version on RubyGems is higher than
2fb58f
the `system_bundler_version` (= `Bundler::VERSION`) in `make test-bundler` on
2fb58f
ruby/ruby.
2fb58f
2fb58f
See <https://bugs.ruby-lang.org/issues/18643>.
2fb58f
---
2fb58f
 spec/bundler/commands/binstubs_spec.rb | 5 ++++-
2fb58f
 1 file changed, 4 insertions(+), 1 deletion(-)
2fb58f
2fb58f
diff --git a/spec/bundler/commands/binstubs_spec.rb b/spec/bundler/commands/binstubs_spec.rb
2fb58f
index 198226207bc..2634f43417c 100644
2fb58f
--- a/spec/bundler/commands/binstubs_spec.rb
2fb58f
+++ b/spec/bundler/commands/binstubs_spec.rb
2fb58f
@@ -226,7 +226,10 @@
2fb58f
 
2fb58f
         it "calls through to the latest bundler version" do
2fb58f
           sys_exec "bin/bundle update --bundler", :env => { "DEBUG" => "1" }
2fb58f
-          expect(out).to include %(Using bundler #{system_bundler_version}\n)
2fb58f
+          using_bundler_line = /Using bundler ([\w\.]+)\n/.match(out)
2fb58f
+          expect(using_bundler_line).to_not be_nil
2fb58f
+          latest_version = using_bundler_line[1]
2fb58f
+          expect(Gem::Version.new(latest_version)).to be >= Gem::Version.new(system_bundler_version)
2fb58f
         end
2fb58f
 
2fb58f
         it "calls through to the explicit bundler version" do