summaryrefslogtreecommitdiff
path: root/spec
diff options
authorHiroshi SHIBATA <[email protected]>2024-11-14 17:42:20 +0900
committerHiroshi SHIBATA <[email protected]>2024-11-15 08:16:03 +0900
commit1063b5a140370a6c43b0ae19e5abc72d74b68b75 (patch)
treefce862e9c7f8cf501d32db36b69ee1795a0443ca /spec
parentb44272fcb456bb723d3dfa3b3736a05a2cbf30b2 (diff)
Port test_warn_dash_gem.rb to RSpec example
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12086
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/bundled_gems_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/bundler/bundled_gems_spec.rb b/spec/bundler/bundled_gems_spec.rb
index 7cc830e2c8..0beed30244 100644
--- a/spec/bundler/bundled_gems_spec.rb
+++ b/spec/bundler/bundled_gems_spec.rb
@@ -22,4 +22,20 @@ RSpec.describe "bundled_gems.rb" do
expect(err).to include(/csv was loaded from (.*) from Ruby 3.4.0/)
expect(err).to include(/ostruct was loaded from (.*) from Ruby 3.5.0/)
end
+
+ it "Show warning dash gem like net/smtp" do
+ script <<-RUBY
+ gemfile do
+ source "https://rubygems.org"
+ end
+
+ begin
+ require "net/smtp"
+ rescue LoadError
+ end
+ RUBY
+
+ expect(err).to include(/net\/smtp was loaded from (.*) from Ruby 3.1.0/)
+ expect(err).to include("You can add net-smtp")
+ end
end