Skip to content

Commit 7494646

Browse files
committed
Use pure ruby library instead of C ext library for dependency warning example
1 parent d11ca20 commit 7494646

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

spec/bundled_gems_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def self.ruby=(ruby)
6464
Gem::BUNDLED_GEMS.send(:remove_const, :PREFIXED)
6565
Gem::BUNDLED_GEMS.const_set(:LIBDIR, File.expand_path(File.join(__dir__, "../../..", "lib")) + "/")
6666
Gem::BUNDLED_GEMS.const_set(:ARCHDIR, File.expand_path($LOAD_PATH.find{|path| path.include?(".ext/common") }) + "/")
67-
Gem::BUNDLED_GEMS.const_set(:SINCE, { "openssl" => RUBY_VERSION, "irb" => "3.5.0", "csv" => "3.4.0", "net-smtp" => "3.1.0" })
67+
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" })
6868
Gem::BUNDLED_GEMS.const_set(:SINCE_FAST_PATH, Gem::BUNDLED_GEMS::SINCE.transform_keys { |g| g.sub(/\A.*\-/, "") } )
6969
Gem::BUNDLED_GEMS.const_set(:PREFIXED, { "openssl" => true })
7070
STUB
@@ -281,29 +281,29 @@ def my
281281

282282
it "Show warning with bootsnap and some gem in Gemfile" do
283283
# Original issue is childprocess 5.0.0 and logger.
284-
build_lib "openssl2", "5.0.0" do |s|
284+
build_lib "fileutils2", "5.0.0" do |s|
285285
# bootsnap expand required feature to full path
286-
rubyextpath = File.expand_path(File.join(__dir__, "..", ".ext", "common"))
287-
s.write "lib/openssl2.rb", "require '#{rubyextpath}/openssl'"
286+
rubylibpath = File.expand_path(File.join(__dir__, "..", "lib"))
287+
s.write "lib/fileutils2.rb", "require '#{rubylibpath}/fileutils'"
288288
end
289289

290290
script <<-RUBY
291291
gemfile do
292292
source "https://rubygems.org"
293293
# gem "bootsnap", require: false
294294
path "#{lib_path}" do
295-
gem "openssl2", "5.0.0"
295+
gem "fileutils2", "5.0.0"
296296
end
297297
end
298298
299299
# require 'bootsnap'
300300
# Bootsnap.setup(cache_dir: 'tmp/cache')
301301
302302
# bootsnap expand required feature to full path
303-
require Gem.loaded_specs["openssl2"].full_gem_path + '/lib/openssl2'
303+
require Gem.loaded_specs["fileutils2"].full_gem_path + '/lib/fileutils2'
304304
RUBY
305305

306-
expect(err).to include(/openssl was loaded from (.*) from Ruby #{RUBY_VERSION}/)
306+
expect(err).to include(/fileutils was loaded from (.*) from Ruby #{RUBY_VERSION}/)
307307
# TODO: We should assert caller location like below:
308308
# $GEM_HOME/gems/childprocess-5.0.0/lib/childprocess.rb:7: warning:
309309
end

0 commit comments

Comments
 (0)