From ea2a00d785576a7dc45c0f6e965de605929e889d Mon Sep 17 00:00:00 2001 From: drbrain Date: Tue, 4 Feb 2014 00:48:31 +0000 Subject: * lib/rubygems: Update to RubyGems 2.2.2 prerelease to check fixes to CI. * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/rubygems/test_gem.rb | 58 +++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 30 deletions(-) (limited to 'test/rubygems/test_gem.rb') diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb index 513f2d4e58..e33742049c 100644 --- a/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb @@ -199,30 +199,21 @@ class TestGem < Gem::TestCase end def test_self_default_exec_format - orig_RUBY_INSTALL_NAME = RbConfig::CONFIG['ruby_install_name'] - RbConfig::CONFIG['ruby_install_name'] = 'ruby' - - assert_equal '%s', Gem.default_exec_format - ensure - RbConfig::CONFIG['ruby_install_name'] = orig_RUBY_INSTALL_NAME + ruby_install_name 'ruby' do + assert_equal '%s', Gem.default_exec_format + end end def test_self_default_exec_format_18 - orig_RUBY_INSTALL_NAME = RbConfig::CONFIG['ruby_install_name'] - RbConfig::CONFIG['ruby_install_name'] = 'ruby18' - - assert_equal '%s18', Gem.default_exec_format - ensure - RbConfig::CONFIG['ruby_install_name'] = orig_RUBY_INSTALL_NAME + ruby_install_name 'ruby18' do + assert_equal '%s18', Gem.default_exec_format + end end def test_self_default_exec_format_jruby - orig_RUBY_INSTALL_NAME = RbConfig::CONFIG['ruby_install_name'] - RbConfig::CONFIG['ruby_install_name'] = 'jruby' - - assert_equal 'j%s', Gem.default_exec_format - ensure - RbConfig::CONFIG['ruby_install_name'] = orig_RUBY_INSTALL_NAME + ruby_install_name 'jruby' do + assert_equal 'j%s', Gem.default_exec_format + end end def test_self_default_sources @@ -340,21 +331,15 @@ class TestGem < Gem::TestCase end def test_self_extension_dir_shared - enable_shared, RbConfig::CONFIG['ENABLE_SHARED'] = - RbConfig::CONFIG['ENABLE_SHARED'], 'yes' - - assert_equal Gem.ruby_api_version, Gem.extension_api_version - ensure - RbConfig::CONFIG['ENABLE_SHARED'] = enable_shared + enable_shared 'yes' do + assert_equal Gem.ruby_api_version, Gem.extension_api_version + end end def test_self_extension_dir_static - enable_shared, RbConfig::CONFIG['ENABLE_SHARED'] = - RbConfig::CONFIG['ENABLE_SHARED'], 'no' - - assert_equal "#{Gem.ruby_api_version}-static", Gem.extension_api_version - ensure - RbConfig::CONFIG['ENABLE_SHARED'] = enable_shared + enable_shared 'no' do + assert_equal "#{Gem.ruby_api_version}-static", Gem.extension_api_version + end end def test_self_find_files @@ -1339,6 +1324,19 @@ class TestGem < Gem::TestCase ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps end + def ruby_install_name name + orig_RUBY_INSTALL_NAME = RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG['ruby_install_name'] = name + + yield + ensure + if orig_RUBY_INSTALL_NAME then + RbConfig::CONFIG['ruby_install_name'] = orig_RUBY_INSTALL_NAME + else + RbConfig::CONFIG.delete 'ruby_install_name' + end + end + def with_plugin(path) test_plugin_path = File.expand_path("test/rubygems/plugin/#{path}", @@project_dir) -- cgit v1.2.3