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

ruby-changes:72166

From: David <ko1@a...>
Date: Wed, 15 Jun 2022 18:14:37 +0900 (JST)
Subject: [ruby-changes:72166] e09bdc11ec (master): [rubygems/rubygems] Support running specs with asdf version manager

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

From e09bdc11ec74272eb9165b777fea43bbb99ae8bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...>
Date: Fri, 20 May 2022 15:04:04 +0200
Subject: [rubygems/rubygems] Support running specs with asdf version manager

The `asdf-ruby` plugin sets `RUBYLIB` to require some code to reshim
after installing gems. This interferes with our specs.

Reset that, but leave any "internal" entries in places, because the
ruby-core test setup also uses RUBYLIB.

https://github.com/rubygems/rubygems/commit/4b2d09af5b
---
 spec/bundler/spec_helper.rb | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/spec/bundler/spec_helper.rb b/spec/bundler/spec_helper.rb
index 23db133b67..5f9ed0ec0a 100644
--- a/spec/bundler/spec_helper.rb
+++ b/spec/bundler/spec_helper.rb
@@ -78,10 +78,19 @@ RSpec.configure do |config| https://github.com/ruby/ruby/blob/trunk/spec/bundler/spec_helper.rb#L78
     ENV["XDG_CONFIG_HOME"] = nil
     ENV["GEMRC"] = nil
 
+    extend(Spec::Helpers)
+
+    # Ruby-core needs RUBYLIB set, leave any "internal" RUBYLIB entries to avoid
+    # resetting that, but reset anything else to avoid external stuff like asdf
+    # hooks from interfering with our specs
+
+    rubylib = ENV["RUBYLIB"]
+    rubylib = rubylib.split(File::PATH_SEPARATOR).select {|p| p.start_with?(git_root.to_s) }.join(File::PATH_SEPARATOR) if rubylib
+    ENV["RUBYLIB"] = rubylib
+
     # Don't wrap output in tests
     ENV["THOR_COLUMNS"] = "10000"
 
-    extend(Spec::Helpers)
     system_gems :bundler, :path => pristine_system_gem_path
   end
 
-- 
cgit v1.2.1


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

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