~ubuntu-branches/ubuntu/quantal/ruby1.9.1/quantal

« back to all changes in this revision

Viewing changes to test/rubygems/test_gem_install_update_options.rb

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2011-09-24 19:16:17 UTC
  • mfrom: (1.1.8 upstream) (13.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20110924191617-o1qz4rcmqjot8zuy
Tags: 1.9.3~rc1-1
* New upstream release: 1.9.3 RC1.
  + Includes load.c fixes. Closes: #639959.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
require_relative 'gem_installer_test_case'
 
1
require 'rubygems/installer_test_case'
2
2
require 'rubygems/install_update_options'
3
3
require 'rubygems/command'
4
4
 
5
 
class TestGemInstallUpdateOptions < GemInstallerTestCase
 
5
class TestGemInstallUpdateOptions < Gem::InstallerTestCase
6
6
 
7
7
  def setup
8
8
    super
13
13
  end
14
14
 
15
15
  def test_add_install_update_options
16
 
    args = %w[-i /install_to --rdoc --ri -E -f -t -w -P HighSecurity
 
16
    args = %w[-i /install_to --rdoc --ri -E -f -w -P HighSecurity
17
17
              --ignore-dependencies --format-exec --include-dependencies]
18
18
 
19
19
    assert @cmd.handles?(args)
40
40
 
41
41
    @installer = Gem::Installer.new @gem, @cmd.options
42
42
    @installer.install
43
 
    assert File.exist?(File.join(Gem.user_dir, 'gems'))
44
 
    assert File.exist?(File.join(Gem.user_dir, 'gems',
45
 
                                 @spec.full_name))
 
43
    assert_path_exists File.join(Gem.user_dir, 'gems')
 
44
    assert_path_exists File.join(Gem.user_dir, 'gems', @spec.full_name)
46
45
  end
47
46
 
48
47
  def test_user_install_disabled_read_only
53
52
 
54
53
      refute @cmd.options[:user_install]
55
54
 
56
 
      File.chmod 0755, @userhome
 
55
      FileUtils.chmod 0755, @userhome
57
56
      FileUtils.chmod 0000, @gemhome
58
57
 
 
58
      Gem.use_paths @gemhome, @userhome
 
59
 
59
60
      assert_raises(Gem::FilePermissionError) do
60
 
        @installer = Gem::Installer.new @gem, @cmd.options
 
61
        Gem::Installer.new(@gem, @cmd.options).install
61
62
      end
62
63
    end
63
64
  ensure
64
65
    FileUtils.chmod 0755, @gemhome
65
66
  end
66
 
 
67
67
end
68