[rubygems/rubygems] Fix error handling of #with_engine_version

* If settings constants fail, show that exception instead of getting
  another one due to variables being unset and hiding the real cause.

https://github.com/rubygems/rubygems/commit/f38cd67874
This commit is contained in:
Benoit Daloze 2019-08-04 14:16:42 +02:00 committed by Hiroshi SHIBATA
parent f9dac1bd54
commit 2ea2108a9f

View File

@ -34,8 +34,8 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
Gem.instance_variable_set :@ruby_version, Gem::Version.new(version)
begin
yield
ensure
Object.send :remove_const, :RUBY_ENGINE if name
Object.send :remove_const, new_engine_version_const if version
@ -50,6 +50,7 @@ class TestGemRequestSetGemDependencyAPI < Gem::TestCase
Gem.send :remove_instance_variable, :@ruby_version if
Gem.instance_variables.include? :@ruby_version
end
end
def test_gempspec_with_multiple_runtime_deps
save_gemspec 'foo', '1.0' do |s|