Port test_warn_dash_gem.rb to RSpec example

This commit is contained in:
Hiroshi SHIBATA 2024-11-14 17:42:20 +09:00
Родитель b44272fcb4
Коммит 1063b5a140
3 изменённых файлов: 16 добавлений и 14 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -8,10 +8,6 @@ echo "* Show warning sub-feature like bigdecimal/util"
ruby test_warn_sub_feature.rb
echo
echo "* Show warning dash gem like net/smtp"
ruby test_warn_dash_gem.rb
echo
echo "* Show warning when bundle exec with ruby and script"
bundle exec ruby test_warn_bundle_exec.rb
echo

Просмотреть файл

@ -1,10 +0,0 @@
require "bundler"
Bundler::Definition.no_lock = true
require "bundler/inline"
gemfile do
source "https://rubygems.org"
end
require "net/smtp"