summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_install_update_options.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2023-10-26 17:54:28 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-12-05 14:28:40 +0900
commit4a71852f757d9c18c023f3f6e993cdf55f74411d (patch)
treeafc299d327445c111083bf121b4b2f2bcddb119d /test/rubygems/test_gem_install_update_options.rb
parenta60718d107d161071f0732d64898e3922d1e3b89 (diff)
[rubygems/rubygems] Set specs as pending at the beginning
And word them consistently with other specs. https://github.com/rubygems/rubygems/commit/eee7afefd3
Diffstat (limited to 'test/rubygems/test_gem_install_update_options.rb')
-rw-r--r--test/rubygems/test_gem_install_update_options.rb23
1 files changed, 10 insertions, 13 deletions
diff --git a/test/rubygems/test_gem_install_update_options.rb b/test/rubygems/test_gem_install_update_options.rb
index 1b84f0bf76..8f92e43bf7 100644
--- a/test/rubygems/test_gem_install_update_options.rb
+++ b/test/rubygems/test_gem_install_update_options.rb
@@ -130,6 +130,9 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase
end
def test_user_install_disabled_read_only
+ pend "skipped on MS Windows (chmod has no effect)" if Gem.win_platform?
+ pend "skipped in root privilege" if Process.uid.zero?
+
@spec = quick_gem "a" do |spec|
util_make_exec spec
end
@@ -137,23 +140,17 @@ class TestGemInstallUpdateOptions < Gem::InstallerTestCase
util_build_gem @spec
@gem = @spec.cache_file
- if Gem.win_platform?
- pend("test_user_install_disabled_read_only test skipped on MS Windows")
- elsif Process.uid.zero?
- pend("test_user_install_disabled_read_only test skipped in root privilege")
- else
- @cmd.handle_options %w[--no-user-install]
+ @cmd.handle_options %w[--no-user-install]
- refute @cmd.options[:user_install]
+ refute @cmd.options[:user_install]
- FileUtils.chmod 0o755, @userhome
- FileUtils.chmod 0o000, @gemhome
+ FileUtils.chmod 0o755, @userhome
+ FileUtils.chmod 0o000, @gemhome
- Gem.use_paths @gemhome, @userhome
+ Gem.use_paths @gemhome, @userhome
- assert_raise(Gem::FilePermissionError) do
- Gem::Installer.at(@gem, @cmd.options).install
- end
+ assert_raise(Gem::FilePermissionError) do
+ Gem::Installer.at(@gem, @cmd.options).install
end
ensure
FileUtils.chmod 0o755, @gemhome