From f0a8bb10448cb6874d0773ed620d2b05187b200c Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Fri, 15 Nov 2024 12:11:36 +0900 Subject: [PATCH] Port test_no_warn_sub_feature.rb to RSpec example --- spec/bundler/bundled_gems_spec.rb | 20 +++++++++++++++++++ tool/test_for_warn_bundled_gems/test.sh | 4 ---- .../test_no_warn_sub_feature.rb | 11 ---------- 3 files changed, 20 insertions(+), 15 deletions(-) delete mode 100644 tool/test_for_warn_bundled_gems/test_no_warn_sub_feature.rb diff --git a/spec/bundler/bundled_gems_spec.rb b/spec/bundler/bundled_gems_spec.rb index e0381548f16e69..34f46fb69a31cc 100644 --- a/spec/bundler/bundled_gems_spec.rb +++ b/spec/bundler/bundled_gems_spec.rb @@ -153,6 +153,26 @@ def my expect(err).to be_empty end + it "Don't show warning fiddle/import when bigdecimal on Gemfile" do + build_lib "fiddle", "1.0.0" do |s| + s.write "lib/fiddle.rb", "puts 'fiddle'" + s.write "lib/fiddle/import.rb", "puts 'fiddle/import'" + end + + script <<-RUBY, env: { "BUNDLER_SPEC_GEM_REPO" => gem_repo1.to_s } + gemfile do + source "https://gem.repo1" + path "#{lib_path}" do + gem "fiddle" + end + end + + require "fiddle/import" + 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'" diff --git a/tool/test_for_warn_bundled_gems/test.sh b/tool/test_for_warn_bundled_gems/test.sh index 0cdfcbf0753c2b..27efaad551c023 100755 --- a/tool/test_for_warn_bundled_gems/test.sh +++ b/tool/test_for_warn_bundled_gems/test.sh @@ -12,10 +12,6 @@ echo "* Show warning with zeitwerk" ruby test_warn_zeitwerk.rb echo -echo "* Don't show warning bigdecimal/util when bigdecimal on Gemfile" -ruby test_no_warn_sub_feature.rb -echo - echo "* Show warning with bootsnap and some gem in Gemfile" ruby test_warn_bootsnap_and_gem.rb echo diff --git a/tool/test_for_warn_bundled_gems/test_no_warn_sub_feature.rb b/tool/test_for_warn_bundled_gems/test_no_warn_sub_feature.rb deleted file mode 100644 index d2b96615cf9285..00000000000000 --- a/tool/test_for_warn_bundled_gems/test_no_warn_sub_feature.rb +++ /dev/null @@ -1,11 +0,0 @@ -require "bundler" -Bundler::Definition.no_lock = true - -require "bundler/inline" - -gemfile do - source "https://rubygems.org" - gem "bigdecimal" -end - -require "bigdecimal/util"