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

ruby-changes:56058

From: Hiroshi <ko1@a...>
Date: Sun, 9 Jun 2019 12:45:50 +0900 (JST)
Subject: [ruby-changes:56058] Hiroshi SHIBATA: 44f7f093ab (trunk): Added the condition for ruby_core repository.

https://git.ruby-lang.org/ruby.git/commit/?id=44f7f093ab

From 44f7f093ab8d8663cbbe31d8a975ae6e8d20724f Mon Sep 17 00:00:00 2001
From: Hiroshi SHIBATA <hsbt@r...>
Date: Sun, 9 Jun 2019 11:00:07 +0900
Subject: Added the condition for ruby_core repository.


diff --git a/spec/bundler/bundler/shared_helpers_spec.rb b/spec/bundler/bundler/shared_helpers_spec.rb
index 8e82d1b..a040c29 100644
--- a/spec/bundler/bundler/shared_helpers_spec.rb
+++ b/spec/bundler/bundler/shared_helpers_spec.rb
@@ -223,6 +223,14 @@ RSpec.describe Bundler::SharedHelpers do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/shared_helpers_spec.rb#L223
       ENV["BUNDLE_GEMFILE"] = "Gemfile"
     end
 
+    let(:setup_path) do
+      if ruby_core?
+        File.expand_path("../../../lib/bundler/setup", __dir__)
+      else
+        File.expand_path("../../lib/bundler/setup", __dir__)
+      end
+    end
+
     shared_examples_for "ENV['PATH'] gets set correctly" do
       before { Dir.mkdir ".bundle" }
 
@@ -236,7 +244,7 @@ RSpec.describe Bundler::SharedHelpers do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/shared_helpers_spec.rb#L244
     shared_examples_for "ENV['RUBYOPT'] gets set correctly" do
       it "ensures -rbundler/setup is at the beginning of ENV['RUBYOPT']" do
         subject.set_bundle_environment
-        expect(ENV["RUBYOPT"].split(" ")).to start_with("-r#{File.expand_path("../../lib/bundler/setup", __dir__)}")
+        expect(ENV["RUBYOPT"].split(" ")).to start_with("-r#{setup_path}")
       end
     end
 
diff --git a/spec/bundler/commands/exec_spec.rb b/spec/bundler/commands/exec_spec.rb
index 8f49c57..fe5cb9f 100644
--- a/spec/bundler/commands/exec_spec.rb
+++ b/spec/bundler/commands/exec_spec.rb
@@ -279,7 +279,12 @@ RSpec.describe "bundle exec" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/exec_spec.rb#L279
     G
 
     rubyopt = ENV["RUBYOPT"]
-    rubyopt = "-r#{File.expand_path("../../lib/bundler/setup", __dir__)} #{rubyopt}"
+    setup_path = if ruby_core?
+                   File.expand_path("../../../lib/bundler/setup", __dir__)
+                 else
+                   File.expand_path("../../lib/bundler/setup", __dir__)
+                 end
+    rubyopt = "-r#{setup_path} #{rubyopt}"
 
     bundle "exec 'echo $RUBYOPT'"
     expect(out).to have_rubyopts(rubyopt)
-- 
cgit v0.10.2


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

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