From 728001caaef3435ffae184d84647bd7f29f0d4d9 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 5 Feb 2026 20:40:10 +0900 Subject: Set Gem::BUNDLED_GEMS::LIBDIR from Spec::Path realpath with symlink at macOS --- spec/bundled_gems_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/bundled_gems_spec.rb b/spec/bundled_gems_spec.rb index c02ae818e0..c6a5be406a 100644 --- a/spec/bundled_gems_spec.rb +++ b/spec/bundled_gems_spec.rb @@ -57,11 +57,12 @@ end 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 -- cgit v1.2.3