aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_install_update_options.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-14 03:30:02 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-14 03:30:02 +0000
commit4de117a61517e839f2c45eaf45d56fc243d6d5b2 (patch)
tree7cb5af7a7eb513e5dddf5e343746b1611e628387 /test/rubygems/test_gem_install_update_options.rb
parente548c09d429a5136285ea81aed418685359ed124 (diff)
downloadruby-4de117a61517e839f2c45eaf45d56fc243d6d5b2.tar.gz
* 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
Diffstat (limited to 'test/rubygems/test_gem_install_update_options.rb')
-rw-r--r--test/rubygems/test_gem_install_update_options.rb34
1 files changed, 34 insertions, 0 deletions
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