Port test_no_warn_dependency.rb to RSpec example

This commit is contained in:
Hiroshi SHIBATA 2024-11-15 10:09:36 +09:00
parent bb20083050
commit 49fde29f77
Notes: git 2024-11-15 05:04:40 +00:00
3 changed files with 23 additions and 17 deletions

View File

@ -85,6 +85,29 @@ RSpec.describe "bundled_gems.rb" do
expect(err).to include(/ostruct was loaded from (.*) from Ruby 3.5.0/)
end
it "Show warning when bundled gems called as dependency" do
build_lib "activesupport", "7.0.7.2" do |s|
s.write "lib/active_support/all.rb", "require 'ostruct'"
end
build_lib "ostruct", "1.0.0" do |s|
s.write "lib/ostruct.rb", "puts 'ostruct'"
end
script <<-RUBY, env: { "BUNDLER_SPEC_GEM_REPO" => gem_repo1.to_s }
gemfile do
source "https://gem.repo1"
path "#{lib_path}" do
gem "activesupport", "7.0.7.2"
gem "ostruct"
end
end
require "active_support/all"
RUBY
expect(err).to be_empty
end
it "Don't show warning with net/smtp when net-smtp on Gemfile" do
build_lib "net-smtp", "1.0.0" do |s|
s.write "lib/net/smtp.rb", "puts 'net-smtp'"

View File

@ -28,10 +28,6 @@ echo "* Show warning with zeitwerk"
ruby test_warn_zeitwerk.rb
echo
echo "* Don't show warning bundled gems on Gemfile"
ruby test_no_warn_dependency.rb
echo
echo "* Don't show warning bigdecimal/util when bigdecimal on Gemfile"
ruby test_no_warn_sub_feature.rb
echo

View File

@ -1,13 +0,0 @@
require "bundler"
Bundler::Definition.no_lock = true
require "bundler/inline"
gemfile do
source "https://rubygems.org"
gem "activesupport", "7.0.7.2"
gem "bigdecimal"
gem "mutex_m"
end
require "active_support/all"