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

ruby-changes:59259

From: Hiroshi <ko1@a...>
Date: Sun, 15 Dec 2019 19:07:08 +0900 (JST)
Subject: [ruby-changes:59259] 286cb3395f (master): Fixed test failures with gem command path on ruby core repo.

https://git.ruby-lang.org/ruby.git/commit/?id=286cb3395f

From 286cb3395f8be493b21d0bdf13bcf40fe5c3ab50 Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@r...>
Date: Sat, 14 Dec 2019 21:19:28 +0900
Subject: Fixed test failures with gem command path on ruby core repo.


diff --git a/spec/bundler/bundler/gem_helper_spec.rb b/spec/bundler/bundler/gem_helper_spec.rb
index c01d65d..29e10d6 100644
--- a/spec/bundler/bundler/gem_helper_spec.rb
+++ b/spec/bundler/bundler/gem_helper_spec.rb
@@ -235,7 +235,7 @@ RSpec.describe Bundler::GemHelper do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/gem_helper_spec.rb#L235
           end
 
           it "uses Kernel.system" do
-            expect(Kernel).to receive(:system).with("gem", "push", app_gem_path.to_s, "--host", "http://example.org").and_return(true)
+            expect(Kernel).to receive(:system).with(gem_bin, "push", app_gem_path.to_s, "--host", "http://example.org").and_return(true)
 
             Rake.application["release"].invoke
           end
diff --git a/spec/bundler/commands/exec_spec.rb b/spec/bundler/commands/exec_spec.rb
index a5d67c6..c1d6e4c 100644
--- a/spec/bundler/commands/exec_spec.rb
+++ b/spec/bundler/commands/exec_spec.rb
@@ -57,7 +57,7 @@ RSpec.describe "bundle exec" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/exec_spec.rb#L57
 
   it "works when exec'ing to rubygems" do
     install_gemfile 'gem "rack"'
-    bundle "exec gem --version"
+    bundle "exec #{gem_cmd} --version"
     expect(out).to eq(Gem::VERSION)
   end
 
diff --git a/spec/bundler/support/path.rb b/spec/bundler/support/path.rb
index eea3161..645da52 100644
--- a/spec/bundler/support/path.rb
+++ b/spec/bundler/support/path.rb
@@ -21,8 +21,12 @@ module Spec https://github.com/ruby/ruby/blob/trunk/spec/bundler/support/path.rb#L21
       @bindir ||= root.join(ruby_core? ? "libexec" : "exe")
     end
 
+    def gem_cmd
+      @gem_cmd ||= ruby_core? ? root.join("bin/gem") : "gem"
+    end
+
     def gem_bin
-      @gem_bin ||= ruby_core? ? ENV["GEM_COMMAND"] : "#{Gem.ruby} -S gem --backtrace"
+      @gem_bin ||= ruby_core? ? ENV["GEM_COMMAND"] : "gem"
     end
 
     def spec_dir
diff --git a/spec/bundler/support/rubygems_ext.rb b/spec/bundler/support/rubygems_ext.rb
index 7e9e832..ee9c750 100644
--- a/spec/bundler/support/rubygems_ext.rb
+++ b/spec/bundler/support/rubygems_ext.rb
@@ -99,7 +99,7 @@ module Spec https://github.com/ruby/ruby/blob/trunk/spec/bundler/support/rubygems_ext.rb#L99
       no_reqs.map!(&:first)
       reqs.map! {|name, req| "'#{name}:#{req}'" }
       deps = reqs.concat(no_reqs).join(" ")
-      gem = Path.gem_bin
+      gem = ENV["GEM_COMMAND"] || "#{Gem.ruby} -S gem --backtrace"
       cmd = "#{gem} install #{deps} --no-document --conservative"
       system(cmd) || raise("Installing gems #{deps} for the tests to use failed!")
     end
-- 
cgit v0.10.2


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

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