summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2026-02-05 20:40:10 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2026-02-06 07:19:59 +0900
commit728001caaef3435ffae184d84647bd7f29f0d4d9 (patch)
tree4d94b10b9ced3da39335e035cfec9e150584e5b8
parent86dba8cfaeabb3b86df921da24b3243b9ce4ab2a (diff)
Set Gem::BUNDLED_GEMS::LIBDIR from Spec::Path realpath with symlink at macOS
-rw-r--r--spec/bundled_gems_spec.rb3
1 files changed, 2 insertions, 1 deletions
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