summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <[email protected]>2025-01-23 12:00:51 +0900
committerHiroshi SHIBATA <[email protected]>2025-01-23 16:09:29 +0900
commit7494646101d828755e4c61f227f0c7a7e67ef693 (patch)
treee4cad9b09312b80152b7634218cd6d1966ebf273
parentd11ca207e9dd469b933be922544e78e5cc357187 (diff)
Use pure ruby library instead of C ext library for dependency warning example
-rw-r--r--spec/bundled_gems_spec.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/bundled_gems_spec.rb b/spec/bundled_gems_spec.rb
index 9a33050713..54a44edc95 100644
--- a/spec/bundled_gems_spec.rb
+++ b/spec/bundled_gems_spec.rb
@@ -64,7 +64,7 @@ RSpec.describe "bundled_gems.rb" do
Gem::BUNDLED_GEMS.send(:remove_const, :PREFIXED)
Gem::BUNDLED_GEMS.const_set(:LIBDIR, File.expand_path(File.join(__dir__, "../../..", "lib")) + "/")
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, "irb" => "3.5.0", "csv" => "3.4.0", "net-smtp" => "3.1.0" })
+ Gem::BUNDLED_GEMS.const_set(:SINCE, { "openssl" => RUBY_VERSION, "fileutils" => RUBY_VERSION, "irb" => "3.5.0", "csv" => "3.4.0", "net-smtp" => "3.1.0" })
Gem::BUNDLED_GEMS.const_set(:SINCE_FAST_PATH, Gem::BUNDLED_GEMS::SINCE.transform_keys { |g| g.sub(/\A.*\-/, "") } )
Gem::BUNDLED_GEMS.const_set(:PREFIXED, { "openssl" => true })
STUB
@@ -281,10 +281,10 @@ RSpec.describe "bundled_gems.rb" do
it "Show warning with bootsnap and some gem in Gemfile" do
# Original issue is childprocess 5.0.0 and logger.
- build_lib "openssl2", "5.0.0" do |s|
+ build_lib "fileutils2", "5.0.0" do |s|
# bootsnap expand required feature to full path
- rubyextpath = File.expand_path(File.join(__dir__, "..", ".ext", "common"))
- s.write "lib/openssl2.rb", "require '#{rubyextpath}/openssl'"
+ rubylibpath = File.expand_path(File.join(__dir__, "..", "lib"))
+ s.write "lib/fileutils2.rb", "require '#{rubylibpath}/fileutils'"
end
script <<-RUBY
@@ -292,7 +292,7 @@ RSpec.describe "bundled_gems.rb" do
source "https://rubygems.org"
# gem "bootsnap", require: false
path "#{lib_path}" do
- gem "openssl2", "5.0.0"
+ gem "fileutils2", "5.0.0"
end
end
@@ -300,10 +300,10 @@ RSpec.describe "bundled_gems.rb" do
# Bootsnap.setup(cache_dir: 'tmp/cache')
# bootsnap expand required feature to full path
- require Gem.loaded_specs["openssl2"].full_gem_path + '/lib/openssl2'
+ require Gem.loaded_specs["fileutils2"].full_gem_path + '/lib/fileutils2'
RUBY
- expect(err).to include(/openssl was loaded from (.*) from Ruby #{RUBY_VERSION}/)
+ expect(err).to include(/fileutils was loaded from (.*) from Ruby #{RUBY_VERSION}/)
# TODO: We should assert caller location like below:
# $GEM_HOME/gems/childprocess-5.0.0/lib/childprocess.rb:7: warning:
end