From 4de117a61517e839f2c45eaf45d56fc243d6d5b2 Mon Sep 17 00:00:00 2001 From: hsbt Date: Sun, 14 Sep 2014 03:30:02 +0000 Subject: * lib/rubygems: Update to RubyGems 2.4.1 master(713ab65) Complete history at: https://github.com/rubygems/rubygems/blob/master/History.txt#L3-L216 * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/rubygems/test_gem_install_update_options.rb | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'test/rubygems/test_gem_install_update_options.rb') diff --git a/test/rubygems/test_gem_install_update_options.rb b/test/rubygems/test_gem_install_update_options.rb index 3f63896999..de09d7a171 100644 --- a/test/rubygems/test_gem_install_update_options.rb +++ b/test/rubygems/test_gem_install_update_options.rb @@ -17,6 +17,7 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase def test_add_install_update_options args = %w[ --document + --build-root build_root --format-exec --ignore-dependencies --rdoc @@ -25,6 +26,7 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase -f -i /install_to -w + --vendor ] args.concat %w[-P HighSecurity] if defined?(OpenSSL::SSL) @@ -32,6 +34,12 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase assert @cmd.handles?(args) end + def test_build_root + @cmd.handle_options %w[--build-root build_root] + + assert_equal File.expand_path('build_root'), @cmd.options[:build_root] + end + def test_doc @cmd.handle_options %w[--doc] @@ -147,4 +155,30 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase ensure FileUtils.chmod 0755, @gemhome end + + def test_vendor + @cmd.handle_options %w[--vendor] + + assert @cmd.options[:vendor] + assert_equal Gem.vendor_dir, @cmd.options[:install_dir] + end + + def test_vendor_missing + orig_vendordir = RbConfig::CONFIG['vendordir'] + RbConfig::CONFIG.delete 'vendordir' + + e = assert_raises OptionParser::InvalidOption do + @cmd.handle_options %w[--vendor] + end + + assert_equal 'invalid option: --vendor your platform is not supported', + e.message + + refute @cmd.options[:vendor] + refute @cmd.options[:install_dir] + + ensure + RbConfig::CONFIG['vendordir'] = orig_vendordir + end + end -- cgit v1.2.3