jaruga / rpms / ruby

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