diff options
author | Hiroshi SHIBATA <[email protected]> | 2024-11-15 10:57:56 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2024-11-15 14:04:19 +0900 |
commit | 587955169e6af51eee32e34d68bc74b0dcec947c (patch) | |
tree | 305557e5e958b493075d1aaf44cdfd7c1a8647c7 | |
parent | 208c46702a1045154b1f8c6d33f1a693d181f475 (diff) |
Port -r option test to RSpec examples
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/12096
-rw-r--r-- | spec/bundler/bundled_gems_spec.rb | 15 | ||||
-rw-r--r-- | tool/test_for_warn_bundled_gems/Gemfile | 0 | ||||
-rw-r--r-- | tool/test_for_warn_bundled_gems/Gemfile.lock | 11 | ||||
-rwxr-xr-x | tool/test_for_warn_bundled_gems/test.sh | 8 |
4 files changed, 15 insertions, 19 deletions
diff --git a/spec/bundler/bundled_gems_spec.rb b/spec/bundler/bundled_gems_spec.rb index 1ed27a1746..05f669d717 100644 --- a/spec/bundler/bundled_gems_spec.rb +++ b/spec/bundler/bundled_gems_spec.rb @@ -88,6 +88,13 @@ RSpec.describe "bundled_gems.rb" do expect(err).to include(/ostruct was loaded from (.*) from Ruby 3.5.0/) 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 script <<-RUBY module My @@ -152,4 +159,12 @@ RSpec.describe "bundled_gems.rb" do expect(err).to be_empty 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 diff --git a/tool/test_for_warn_bundled_gems/Gemfile b/tool/test_for_warn_bundled_gems/Gemfile deleted file mode 100644 index e69de29bb2..0000000000 --- a/tool/test_for_warn_bundled_gems/Gemfile +++ /dev/null diff --git a/tool/test_for_warn_bundled_gems/Gemfile.lock b/tool/test_for_warn_bundled_gems/Gemfile.lock deleted file mode 100644 index 003cb81444..0000000000 --- a/tool/test_for_warn_bundled_gems/Gemfile.lock +++ /dev/null @@ -1,11 +0,0 @@ -GEM - specs: - -PLATFORMS - arm64-darwin-22 - ruby - -DEPENDENCIES - -BUNDLED WITH - 2.5.0.dev diff --git a/tool/test_for_warn_bundled_gems/test.sh b/tool/test_for_warn_bundled_gems/test.sh index 35067da40a..3813a4d268 100755 --- a/tool/test_for_warn_bundled_gems/test.sh +++ b/tool/test_for_warn_bundled_gems/test.sh @@ -4,10 +4,6 @@ echo "* Show warning sub-feature like bigdecimal/util" ruby test_warn_sub_feature.rb echo -echo "* Show warning when bundle exec with -r option" -bundle exec ruby -rostruct -e '' -echo - echo "* Show warning with bootsnap" ruby test_warn_bootsnap.rb echo @@ -27,7 +23,3 @@ echo echo "* Show warning with bootsnap and some gem in Gemfile" ruby test_warn_bootsnap_and_gem.rb echo - -echo "* Don't show warning for reline when using irb from standard library" -bundle exec ruby -rirb -e '' -echo |