Sha256: c855b757704fac6ed8a0ff6c9508d970aa95a6c03b9727051cc89794088b4f7d

Contents?: true

Size: 670 Bytes

Versions: 3

Compression:

Stored size: 670 Bytes

Contents

require 'rubygems/test_case'
require 'rubygems/doc_manager'

class TestGemDocManager < Gem::TestCase

  def setup
    super

    @spec = quick_gem 'a'
    @manager = Gem::DocManager.new(@spec)
  end

  def test_uninstall_doc_unwritable
    orig_mode = File.stat(@spec.installation_path).mode

    # File.chmod has no effect on MS Windows directories (it needs ACL).
    if win_platform?
      skip("test_uninstall_doc_unwritable skipped on MS Windows")
    else
      File.chmod(0, @spec.installation_path)
    end

    assert_raises Gem::FilePermissionError do
      @manager.uninstall_doc
    end
  ensure
    File.chmod orig_mode, @spec.installation_path
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubygems-update-1.5.3 test/rubygems/test_gem_doc_manager.rb
rubygems-update-1.5.2 test/rubygems/test_gem_doc_manager.rb
rubygems-update-1.5.0 test/rubygems/test_gem_doc_manager.rb