~ubuntu-branches/ubuntu/trusty/ruby1.9/trusty

« back to all changes in this revision

Viewing changes to test/rubygems/test_gem_doc_manager.rb

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2008-01-24 11:42:29 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080124114229-jw2f87rdxlq6gp11
Tags: 1.9.0.0-2ubuntu1
* Merge from debian unstable, remaining changes:
  - Robustify check for target_os, fixing build failure on lpia.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#--
 
2
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
 
3
# All rights reserved.
 
4
# See LICENSE.txt for permissions.
 
5
#++
 
6
 
 
7
require 'test/unit'
 
8
require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities')
 
9
require 'rubygems/doc_manager'
 
10
 
 
11
class TestGemDocManager < RubyGemTestCase
 
12
 
 
13
  def setup
 
14
    super
 
15
 
 
16
    @spec = quick_gem 'a'
 
17
    @manager = Gem::DocManager.new(@spec)
 
18
  end
 
19
 
 
20
  def test_uninstall_doc_unwritable
 
21
    orig_mode = File.stat(@spec.installation_path).mode
 
22
    File.chmod 0, @spec.installation_path
 
23
 
 
24
    assert_raise Gem::FilePermissionError do
 
25
      @manager.uninstall_doc
 
26
    end
 
27
  ensure
 
28
    File.chmod orig_mode, @spec.installation_path
 
29
  end
 
30
 
 
31
end
 
32