Port bundle exec with shebang script to RSpec example

This commit is contained in:
Hiroshi SHIBATA 2024-11-15 10:50:44 +09:00
parent 703cffffc9
commit 208c46702a
Notes: git 2024-11-15 05:04:39 +00:00
3 changed files with 14 additions and 7 deletions

View File

@ -74,6 +74,20 @@ 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 shebang's script" do
code = <<-RUBY
#!/usr/bin/env ruby
require "ostruct"
RUBY
create_file("script.rb", code)
FileUtils.chmod(0o777, bundled_app("script.rb"))
create_file("Gemfile", "source 'https://rubygems.org'")
bundle "exec ./script.rb"
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

View File

@ -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 shebang's script"
bundle exec ./test_warn_bundle_exec_shebang.rb
echo
echo "* Show warning when bundle exec with -r option"
bundle exec ruby -rostruct -e ''
echo

View File

@ -1,3 +0,0 @@
#!/usr/bin/env ruby
require "base64"