Port test_warn_bootsnap_rubyarchdir_gem.rb to RSpec example
This commit is contained in:
parent
0afd77d76a
commit
5395afd422
Notes:
git
2024-11-15 08:50:47 +00:00
@ -173,6 +173,26 @@ RSpec.describe "bundled_gems.rb" do
|
|||||||
# test_warn_bootsnap.rb:14: warning: ...
|
# test_warn_bootsnap.rb:14: warning: ...
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "Show warning with bootsnap for gem with native extension" do
|
||||||
|
script <<-RUBY
|
||||||
|
gemfile do
|
||||||
|
source "https://rubygems.org"
|
||||||
|
# gem "bootsnap", require: false
|
||||||
|
end
|
||||||
|
|
||||||
|
# require 'bootsnap'
|
||||||
|
# Bootsnap.setup(cache_dir: 'tmp/cache')
|
||||||
|
|
||||||
|
# bootsnap expand required feature to full path
|
||||||
|
# require 'fiddle'
|
||||||
|
require Gem::BUNDLED_GEMS::ARCHDIR + "fiddle"
|
||||||
|
RUBY
|
||||||
|
|
||||||
|
expect(err).to include(/fiddle was loaded from (.*) from Ruby 3.5.0/)
|
||||||
|
# TODO: We should assert caller location like below:
|
||||||
|
# test_warn_bootsnap_rubyarchdir_gem.rb:14: warning: ...
|
||||||
|
end
|
||||||
|
|
||||||
it "Don't show warning fiddle/import when fiddle on Gemfile" do
|
it "Don't show warning fiddle/import when fiddle on Gemfile" do
|
||||||
build_lib "fiddle", "1.0.0" do |s|
|
build_lib "fiddle", "1.0.0" do |s|
|
||||||
s.write "lib/fiddle.rb", "puts 'fiddle'"
|
s.write "lib/fiddle.rb", "puts 'fiddle'"
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
echo "* Show warning with bootsnap for gem with native extension"
|
|
||||||
ruby test_warn_bootsnap_rubyarchdir_gem.rb
|
|
||||||
echo
|
|
||||||
|
|
||||||
echo "* Show warning with zeitwerk"
|
echo "* Show warning with zeitwerk"
|
||||||
ruby test_warn_zeitwerk.rb
|
ruby test_warn_zeitwerk.rb
|
||||||
echo
|
echo
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
require "bundler"
|
|
||||||
Bundler::Definition.no_lock = true
|
|
||||||
|
|
||||||
require "bundler/inline"
|
|
||||||
|
|
||||||
gemfile do
|
|
||||||
source "https://rubygems.org"
|
|
||||||
gem "bootsnap", require: false
|
|
||||||
end
|
|
||||||
|
|
||||||
require 'bootsnap'
|
|
||||||
Bootsnap.setup(cache_dir: 'tmp/cache')
|
|
||||||
|
|
||||||
require 'syslog'
|
|
Loading…
x
Reference in New Issue
Block a user