Skip to content

Commit

Permalink
[rubygems/rubygems] Set specs as pending at the beginning
Browse files Browse the repository at this point in the history
And word them consistently with other specs.

rubygems/rubygems@eee7afefd3
  • Loading branch information
deivid-rodriguez authored and hsbt committed Dec 5, 2023
1 parent a60718d commit 4a71852
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions test/rubygems/test_gem_install_update_options.rb
Expand Up @@ -130,30 +130,27 @@ def test_user_install_enabled
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

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
Expand Down

0 comments on commit 4a71852

Please sign in to comment.