aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_install_update_options.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-09 21:38:59 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-09 21:38:59 +0000
commit31c94ffeb5f09d09ac2c86fc9e6614e38251a43d (patch)
tree10e44506238c7af3d7c9d822111996731726e38d /test/rubygems/test_gem_install_update_options.rb
parenta6afbaeb3be396c0fdea3b9077d9256c59edcfca (diff)
downloadruby-31c94ffeb5f09d09ac2c86fc9e6614e38251a43d.tar.gz
Update to RubyGems 1.3.4 r2223
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23659 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.rb26
1 files changed, 20 insertions, 6 deletions
diff --git a/test/rubygems/test_gem_install_update_options.rb b/test/rubygems/test_gem_install_update_options.rb
index 8610a79cdf..fb77678d0d 100644
--- a/test/rubygems/test_gem_install_update_options.rb
+++ b/test/rubygems/test_gem_install_update_options.rb
@@ -1,4 +1,3 @@
-require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
require File.join(File.expand_path(File.dirname(__FILE__)),
'gem_installer_test_case')
require 'rubygems/install_update_options'
@@ -21,6 +20,11 @@ class TestGemInstallUpdateOptions < GemInstallerTestCase
assert @cmd.handles?(args)
end
+ def test_prerelease
+ @cmd.handle_options %w[--prerelease]
+ assert_equal true, @cmd.options[:prerelease]
+ end
+
def test_security_policy
@cmd.handle_options %w[-P HighSecurity]
@@ -38,6 +42,8 @@ class TestGemInstallUpdateOptions < GemInstallerTestCase
def test_user_install_enabled
@cmd.handle_options %w[--user-install]
+ assert @cmd.options[:user_install]
+
@installer = Gem::Installer.new @gem, @cmd.options
@installer.install
assert File.exist?(File.join(Gem.user_dir, 'gems'))
@@ -46,15 +52,23 @@ class TestGemInstallUpdateOptions < GemInstallerTestCase
end
def test_user_install_disabled_read_only
- @cmd.handle_options %w[--no-user-install]
+ if win_platform?
+ skip('test_user_install_disabled_read_only test skipped on MS Windows')
+ else
+ @cmd.handle_options %w[--no-user-install]
- File.chmod 0755, @userhome
- FileUtils.chmod 0000, @gemhome
+ refute @cmd.options[:user_install]
- assert_raises(Gem::FilePermissionError) do
- @installer = Gem::Installer.new @gem, @cmd.options
+ File.chmod 0755, @userhome
+ FileUtils.chmod 0000, @gemhome
+
+ assert_raises(Gem::FilePermissionError) do
+ @installer = Gem::Installer.new @gem, @cmd.options
+ end
end
ensure
FileUtils.chmod 0755, @gemhome
end
+
end
+