diff --git a/spec/bundled_gems_spec.rb b/spec/bundled_gems_spec.rb index c02ae818e0d064..c6a5be406afc0f 100644 --- a/spec/bundled_gems_spec.rb +++ b/spec/bundled_gems_spec.rb @@ -57,11 +57,12 @@ def self.ruby=(ruby) RSpec.describe "bundled_gems.rb" do let(:stub_code) { + source_lib_dir = File.realpath(Spec::Path.source_lib_dir.to_s) <<~STUB Gem::BUNDLED_GEMS.send(:remove_const, :LIBDIR) Gem::BUNDLED_GEMS.send(:remove_const, :ARCHDIR) Gem::BUNDLED_GEMS.send(:remove_const, :SINCE) - Gem::BUNDLED_GEMS.const_set(:LIBDIR, File.expand_path(File.join(__dir__, "../../..", "lib")) + "/") + Gem::BUNDLED_GEMS.const_set(:LIBDIR, "#{source_lib_dir}/") Gem::BUNDLED_GEMS.const_set(:ARCHDIR, File.expand_path($LOAD_PATH.find{|path| path.include?(".ext/common") }) + "/") Gem::BUNDLED_GEMS.const_set(:SINCE, { "openssl" => RUBY_VERSION, "fileutils" => RUBY_VERSION, "csv" => "3.4.0", "net-smtp" => "3.1.0" }) STUB