summaryrefslogtreecommitdiff
path: root/spec/bundler
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2022-10-29 01:19:36 +0900
committergit <svn-admin@ruby-lang.org>2022-11-10 22:45:31 +0000
commitb5f809c4961bd43b8e77cceebad44e341618998d (patch)
treeab62bbd238f21cada480324ad29ab7344c6988bc /spec/bundler
parent06e17d7659f42cd59634931e5c8d9dd211c7b2e6 (diff)
[rubygems/rubygems] Load "bundler/setup" in lib/rubygems.rb
Ruby interpreter loads some special gems at startup: did_you_mean, error_highlight, and syntax_suggest. These gems are loaded before `bundler/setup` is loaded by `RUBYOPT=-rbundler/setup`. So, the versions of the gems are not controllable by Gemfile. This change will `require "bundler/setup"` in rubygems.rb (i.e., before the special gems are loaded). Now `bundle exec` sets an environment variable `BUNDLER_SETUP`, and rubygems requires the variable if defined. See also: https://bugs.ruby-lang.org/issues/19089 https://github.com/rubygems/rubygems/commit/963cb65a2d
Diffstat (limited to 'spec/bundler')
-rw-r--r--spec/bundler/bundler/shared_helpers_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/bundler/bundler/shared_helpers_spec.rb b/spec/bundler/bundler/shared_helpers_spec.rb
index 68a24be31c..569d6ed9cd 100644
--- a/spec/bundler/bundler/shared_helpers_spec.rb
+++ b/spec/bundler/bundler/shared_helpers_spec.rb
@@ -246,6 +246,13 @@ RSpec.describe Bundler::SharedHelpers do
end
end
+ shared_examples_for "ENV['BUNDLER_SETUP'] gets set correctly" do
+ it "ensures bundler/setup is set in ENV['BUNDLE_SETUP']" do
+ subject.set_bundle_environment
+ expect(ENV["BUNDLER_SETUP"]).to eq("#{source_lib_dir}/bundler/setup")
+ end
+ end
+
shared_examples_for "ENV['RUBYLIB'] gets set correctly" do
let(:ruby_lib_path) { "stubbed_ruby_lib_dir" }