summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2024-11-14 18:13:43 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2024-11-15 08:16:03 +0900
commit11265baed972fa717041a351b815add7fcdc14aa (patch)
tree61efbe4971f1776e7707ff8f9d0c720a7afe71a7
parent2d2e5a38bf1fdbd3decc8b459a82b29fb4a4f46a (diff)
Use environmental variable for bundled_gems_spec.rb
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12086
-rw-r--r--lib/bundled_gems.rb2
-rw-r--r--spec/bundler/bundled_gems_spec.rb2
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/bundled_gems.rb b/lib/bundled_gems.rb
index 6a20f51958..4427eeb873 100644
--- a/lib/bundled_gems.rb
+++ b/lib/bundled_gems.rb
@@ -52,7 +52,7 @@ module Gem::BUNDLED_GEMS
WARNED = {} # unfrozen
conf = ::RbConfig::CONFIG
- if !File.exist?(conf["rubylibdir"])
+ if ENV["TEST_BUNDLED_GEMS"]
LIBDIR = (File.expand_path(File.join(__dir__, "..", "lib")) + "/").freeze
else
LIBDIR = (conf["rubylibdir"] + "/").freeze
diff --git a/spec/bundler/bundled_gems_spec.rb b/spec/bundler/bundled_gems_spec.rb
index 746a7c695b..f2f908b341 100644
--- a/spec/bundler/bundled_gems_spec.rb
+++ b/spec/bundler/bundled_gems_spec.rb
@@ -1,6 +1,8 @@
require "bundled_gems"
RSpec.describe "bundled_gems.rb" do
+ ENV["TEST_BUNDLED_GEMS"] = "true"
+
def script(code, options = {})
options[:artifice] ||= "compact_index"
ruby("require 'bundler/inline'\n\n" + code, options)