[前][次][番号順一覧][スレッド一覧]

ruby-changes:71477

From: Jun <ko1@a...>
Date: Wed, 23 Mar 2022 00:01:34 +0900 (JST)
Subject: [ruby-changes:71477] 1ff174bfd1 (master): [rubygems/rubygems] Fix a test for `bin/bundle update --bundler` to pass on ruby/ruby.

https://git.ruby-lang.org/ruby.git/commit/?id=1ff174bfd1

From 1ff174bfd17f80433f2cb9888eafd1c297efd2a5 Mon Sep 17 00:00:00 2001
From: Jun Aruga <jaruga@r...>
Date: Mon, 21 Mar 2022 15:36:51 +0100
Subject: [rubygems/rubygems] 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 <https://bugs.ruby-lang.org/issues/18643>.

https://github.com/rubygems/rubygems/commit/bfa2f72cfa
---
 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 198226207b..2634f43417 100644
--- a/spec/bundler/commands/binstubs_spec.rb
+++ b/spec/bundler/commands/binstubs_spec.rb
@@ -226,7 +226,10 @@ RSpec.describe "bundle binstubs <gem>" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/binstubs_spec.rb#L226
 
         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
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]