diff options
author | Hiroshi SHIBATA <[email protected]> | 2024-11-15 09:22:52 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2024-11-15 14:04:19 +0900 |
commit | 699e710ad86a9fa3dcc7d80fcc4f71a39e65ddcd (patch) | |
tree | 2c703f33946e4f5bb932e02d5d03dc6af3c9a913 | |
parent | 8e98fbdd19e49e6972d1eda1523b699b99a825f6 (diff) |
Port test_no_warn_dash_gem.rb to RSpec example
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/12096
-rw-r--r-- | spec/bundler/bundled_gems_spec.rb | 19 | ||||
-rwxr-xr-x | tool/test_for_warn_bundled_gems/test.sh | 4 | ||||
-rw-r--r-- | tool/test_for_warn_bundled_gems/test_no_warn_dash_gem.rb | 11 |
3 files changed, 19 insertions, 15 deletions
diff --git a/spec/bundler/bundled_gems_spec.rb b/spec/bundler/bundled_gems_spec.rb index f2f908b341..90efd28194 100644 --- a/spec/bundler/bundled_gems_spec.rb +++ b/spec/bundler/bundled_gems_spec.rb @@ -63,4 +63,23 @@ RSpec.describe "bundled_gems.rb" do expect(err).to include(/ostruct was loaded from (.*) from Ruby 3.5.0/) 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'" + end + + script <<-RUBY, env: { "BUNDLER_SPEC_GEM_REPO" => gem_repo1.to_s } + gemfile do + source "https://gem.repo1" + path "#{lib_path}" do + gem "net-smtp" + end + end + + require "net/smtp" + RUBY + + expect(err).to be_empty + end end diff --git a/tool/test_for_warn_bundled_gems/test.sh b/tool/test_for_warn_bundled_gems/test.sh index 539a2ef8ff..748b5159bd 100755 --- a/tool/test_for_warn_bundled_gems/test.sh +++ b/tool/test_for_warn_bundled_gems/test.sh @@ -36,10 +36,6 @@ echo "* Don't show warning bundled gems on Gemfile" ruby test_no_warn_dependency.rb echo -echo "* Don't show warning with net/smtp when net-smtp on Gemfile" -ruby test_no_warn_dash_gem.rb -echo - echo "* Don't show warning bigdecimal/util when bigdecimal on Gemfile" ruby test_no_warn_sub_feature.rb echo diff --git a/tool/test_for_warn_bundled_gems/test_no_warn_dash_gem.rb b/tool/test_for_warn_bundled_gems/test_no_warn_dash_gem.rb deleted file mode 100644 index 0c6e1c9354..0000000000 --- a/tool/test_for_warn_bundled_gems/test_no_warn_dash_gem.rb +++ /dev/null @@ -1,11 +0,0 @@ -require "bundler" -Bundler::Definition.no_lock = true - -require "bundler/inline" - -gemfile do - source "https://rubygems.org" - gem "net-smtp" -end - -require "net/smtp" |