зеркало из https://github.com/github/ruby.git
Port test_warn_redefined.rb to RSpec example
This commit is contained in:
Родитель
1063b5a140
Коммит
2d2e5a38bf
|
@ -38,4 +38,27 @@ RSpec.describe "bundled_gems.rb" do
|
|||
expect(err).to include(/net\/smtp was loaded from (.*) from Ruby 3.1.0/)
|
||||
expect(err).to include("You can add net-smtp")
|
||||
end
|
||||
|
||||
it "Show warning when warn is not the standard one in the current scope" do
|
||||
script <<-RUBY
|
||||
module My
|
||||
def warn(msg)
|
||||
end
|
||||
|
||||
def my
|
||||
gemfile do
|
||||
source "https://rubygems.org"
|
||||
end
|
||||
|
||||
require "ostruct"
|
||||
end
|
||||
|
||||
extend self
|
||||
end
|
||||
|
||||
My.my
|
||||
RUBY
|
||||
|
||||
expect(err).to include(/ostruct was loaded from (.*) from Ruby 3.5.0/)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -44,10 +44,6 @@ echo "* Don't show warning bigdecimal/util when bigdecimal on Gemfile"
|
|||
ruby test_no_warn_sub_feature.rb
|
||||
echo
|
||||
|
||||
echo "* Show warning when warn is not the standard one in the current scope"
|
||||
ruby test_warn_redefined.rb
|
||||
echo
|
||||
|
||||
echo "* Show warning with bootsnap and some gem in Gemfile"
|
||||
ruby test_warn_bootsnap_and_gem.rb
|
||||
echo
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
require "bundler"
|
||||
Bundler::Definition.no_lock = true
|
||||
|
||||
module My
|
||||
def warn(msg)
|
||||
end
|
||||
|
||||
def my
|
||||
require "bundler/inline"
|
||||
|
||||
gemfile do
|
||||
source "https://rubygems.org"
|
||||
end
|
||||
|
||||
require "csv"
|
||||
end
|
||||
|
||||
extend self
|
||||
end
|
||||
|
||||
My.my
|
Загрузка…
Ссылка в новой задаче