Port -r option test to RSpec examples

This commit is contained in:
Hiroshi SHIBATA 2024-11-15 10:57:56 +09:00
parent 208c46702a
commit 587955169e
Notes: git 2024-11-15 05:04:39 +00:00
4 changed files with 15 additions and 19 deletions

View File

@ -88,6 +88,13 @@ RSpec.describe "bundled_gems.rb" do
expect(err).to include(/ostruct was loaded from (.*) from Ruby 3.5.0/) expect(err).to include(/ostruct was loaded from (.*) from Ruby 3.5.0/)
end end
it "Show warning when bundle exec with -r option" do
create_file("Gemfile", "source 'https://rubygems.org'")
bundle "exec ruby -rostruct -e ''"
expect(err).to include(/ostruct was loaded from (.*) from Ruby 3.5.0/)
end
it "Show warning when warn is not the standard one in the current scope" do it "Show warning when warn is not the standard one in the current scope" do
script <<-RUBY script <<-RUBY
module My module My
@ -152,4 +159,12 @@ RSpec.describe "bundled_gems.rb" do
expect(err).to be_empty expect(err).to be_empty
end end
it "Don't show warning for reline when using irb from standard library" do
create_file("Gemfile", "source 'https://rubygems.org'")
bundle "exec ruby -rirb -e ''"
expect(err).to include(/irb was loaded from (.*) from Ruby 3.5.0/)
expect(err).to_not include(/reline was loaded from (.*) from Ruby 3.5.0/)
end
end end

View File

@ -1,11 +0,0 @@
GEM
specs:
PLATFORMS
arm64-darwin-22
ruby
DEPENDENCIES
BUNDLED WITH
2.5.0.dev

View File

@ -4,10 +4,6 @@ echo "* Show warning sub-feature like bigdecimal/util"
ruby test_warn_sub_feature.rb ruby test_warn_sub_feature.rb
echo echo
echo "* Show warning when bundle exec with -r option"
bundle exec ruby -rostruct -e ''
echo
echo "* Show warning with bootsnap" echo "* Show warning with bootsnap"
ruby test_warn_bootsnap.rb ruby test_warn_bootsnap.rb
echo echo
@ -27,7 +23,3 @@ echo
echo "* Show warning with bootsnap and some gem in Gemfile" echo "* Show warning with bootsnap and some gem in Gemfile"
ruby test_warn_bootsnap_and_gem.rb ruby test_warn_bootsnap_and_gem.rb
echo echo
echo "* Don't show warning for reline when using irb from standard library"
bundle exec ruby -rirb -e ''
echo