mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* lib/rubygems/installer.rb (Gem::Installer#initialize): fixed
typos. * test/rubygems/test_gem.rb (test_self_dir): removed false assertions. * test/rubygems/test_gem.rb (test_self_set_paths): checks if paths are included. * test/rubygems/test_gem_commands_install_command.rb (test_execute_remote): checks diagnostic message too. * test/rubygems/test_gem_installer.rb (load): uses Gem.ruby. * test/rubygems/gemutilities.rb (Gem.ruby): initializes from the environment variable to run without installation. * test/rubygems/gemutilities.rb (RubyGemTestCase#util_build_gem): creates cache directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									9e83ce20b1
								
							
						
					
					
						commit
						018e1e4f5e
					
				
					 6 changed files with 44 additions and 12 deletions
				
			
		
							
								
								
									
										22
									
								
								ChangeLog
									
										
									
									
									
								
							
							
						
						
									
										22
									
								
								ChangeLog
									
										
									
									
									
								
							| 
						 | 
					@ -1,3 +1,25 @@
 | 
				
			||||||
 | 
					Thu Jan 22 16:29:50 2009  Nobuyoshi Nakada  <nobu@ruby-lang.org>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* lib/rubygems/installer.rb (Gem::Installer#initialize): fixed
 | 
				
			||||||
 | 
						  typos.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* test/rubygems/test_gem.rb (test_self_dir): removed false
 | 
				
			||||||
 | 
						  assertions.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* test/rubygems/test_gem.rb (test_self_set_paths): checks if paths
 | 
				
			||||||
 | 
						  are included.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* test/rubygems/test_gem_commands_install_command.rb
 | 
				
			||||||
 | 
						  (test_execute_remote): checks diagnostic message too.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* test/rubygems/test_gem_installer.rb (load): uses Gem.ruby.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* test/rubygems/gemutilities.rb (Gem.ruby): initializes from the
 | 
				
			||||||
 | 
						  environment variable to run without installation.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						* test/rubygems/gemutilities.rb (RubyGemTestCase#util_build_gem):
 | 
				
			||||||
 | 
						  creates cache directory.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Thu Jan 22 16:12:51 2009  NAKAMURA Usaku  <usa@ruby-lang.org>
 | 
					Thu Jan 22 16:12:51 2009  NAKAMURA Usaku  <usa@ruby-lang.org>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	* revert previous revision.  it's already out-of-date.
 | 
						* revert previous revision.  it's already out-of-date.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -118,8 +118,8 @@ class Gem::Installer
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    begin
 | 
					    begin
 | 
				
			||||||
      FileUtils.mkdir_p @gem_home
 | 
					      FileUtils.mkdir_p @gem_home
 | 
				
			||||||
    rescue Errno::EACCESS, Errno::ENOTDIR
 | 
					    rescue Errno::EACCES, Errno::ENOTDIR
 | 
				
			||||||
      # We'll divert to ~/.gems below
 | 
					      # We'll divert to ~/.gem below
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if not File.writable? @gem_home or
 | 
					    if not File.writable? @gem_home or
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -24,6 +24,8 @@ require 'rubygems/test_utilities'
 | 
				
			||||||
require File.join(File.expand_path(File.dirname(__FILE__)), 'mockgemui')
 | 
					require File.join(File.expand_path(File.dirname(__FILE__)), 'mockgemui')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
module Gem
 | 
					module Gem
 | 
				
			||||||
 | 
					  @ruby = ENV['RUBY']
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def self.searcher=(searcher)
 | 
					  def self.searcher=(searcher)
 | 
				
			||||||
    MUTEX.synchronize do @searcher = searcher end
 | 
					    MUTEX.synchronize do @searcher = searcher end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
| 
						 | 
					@ -252,8 +254,10 @@ class RubyGemTestCase < MiniTest::Unit::TestCase
 | 
				
			||||||
        Gem::Builder.new(spec).build
 | 
					        Gem::Builder.new(spec).build
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      cache_dir = File.join(@gemhome, 'cache')
 | 
				
			||||||
 | 
					      FileUtils.mkdir_p cache_dir
 | 
				
			||||||
      FileUtils.mv "#{spec.full_name}.gem",
 | 
					      FileUtils.mv "#{spec.full_name}.gem",
 | 
				
			||||||
                   File.join(@gemhome, 'cache', "#{spec.original_name}.gem")
 | 
					                   File.join(cache_dir, "#{spec.original_name}.gem")
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -152,11 +152,6 @@ class TestGem < RubyGemTestCase
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def test_self_dir
 | 
					  def test_self_dir
 | 
				
			||||||
    assert_equal @gemhome, Gem.dir
 | 
					    assert_equal @gemhome, Gem.dir
 | 
				
			||||||
 | 
					 | 
				
			||||||
    Gem::DIRECTORIES.each do |filename|
 | 
					 | 
				
			||||||
      assert File.directory?(File.join(Gem.dir, filename)),
 | 
					 | 
				
			||||||
             "expected #{filename} to exist"
 | 
					 | 
				
			||||||
    end
 | 
					 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def test_self_ensure_gem_directories
 | 
					  def test_self_ensure_gem_directories
 | 
				
			||||||
| 
						 | 
					@ -483,9 +478,10 @@ class TestGem < RubyGemTestCase
 | 
				
			||||||
    other = File.join @tempdir, 'other'
 | 
					    other = File.join @tempdir, 'other'
 | 
				
			||||||
    path = [@userhome, other].join File::PATH_SEPARATOR
 | 
					    path = [@userhome, other].join File::PATH_SEPARATOR
 | 
				
			||||||
    Gem.send :set_paths, path
 | 
					    Gem.send :set_paths, path
 | 
				
			||||||
 | 
					    path = Gem.path
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    assert File.exist?(File.join(@userhome, 'gems'))
 | 
					    assert_equal path[0], @userhome
 | 
				
			||||||
    assert File.exist?(File.join(other, 'gems'))
 | 
					    assert_equal path[1], other
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def test_self_set_paths_nonexistent_home
 | 
					  def test_self_set_paths_nonexistent_home
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -112,9 +112,18 @@ class TestGemCommandsInstallCommand < RubyGemTestCase
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @cmd.options[:args] = [@a2.name]
 | 
					    @cmd.options[:args] = [@a2.name]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    err = ""
 | 
				
			||||||
 | 
					    class << err
 | 
				
			||||||
 | 
					      alias write <<
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
    use_ui @ui do
 | 
					    use_ui @ui do
 | 
				
			||||||
      e = assert_raises Gem::SystemExitException do
 | 
					      e = assert_raises Gem::SystemExitException do
 | 
				
			||||||
        @cmd.execute
 | 
					        stderr, $stderr = $stderr, err
 | 
				
			||||||
 | 
					        begin
 | 
				
			||||||
 | 
					          @cmd.execute
 | 
				
			||||||
 | 
					        ensure
 | 
				
			||||||
 | 
					          $stderr = stderr
 | 
				
			||||||
 | 
					        end
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
      assert_equal 0, e.exit_code
 | 
					      assert_equal 0, e.exit_code
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
| 
						 | 
					@ -127,6 +136,7 @@ class TestGemCommandsInstallCommand < RubyGemTestCase
 | 
				
			||||||
    assert_equal "Installing RDoc documentation for #{@a2.full_name}...",
 | 
					    assert_equal "Installing RDoc documentation for #{@a2.full_name}...",
 | 
				
			||||||
                 out.shift
 | 
					                 out.shift
 | 
				
			||||||
    assert out.empty?, out.inspect
 | 
					    assert out.empty?, out.inspect
 | 
				
			||||||
 | 
					    assert_match /^Updating class cache with \d+ classes/, err
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def test_execute_two
 | 
					  def test_execute_two
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -508,7 +508,7 @@ load 'my_exec'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @installer.generate_bin
 | 
					    @installer.generate_bin
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    default_shebang = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
 | 
					    default_shebang = Gem.ruby
 | 
				
			||||||
    shebang_line = open("#{@gemhome}/bin/my_exec") { |f| f.readlines.first }
 | 
					    shebang_line = open("#{@gemhome}/bin/my_exec") { |f| f.readlines.first }
 | 
				
			||||||
    assert_match(/\A#!/, shebang_line)
 | 
					    assert_match(/\A#!/, shebang_line)
 | 
				
			||||||
    assert_match(/#{default_shebang}/, shebang_line)
 | 
					    assert_match(/#{default_shebang}/, shebang_line)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue