From 1df42597d15416357a20bd68700ce1a2d245e8bb Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 7 Mar 2011 08:44:45 +0000 Subject: cancel subversion backfire. sorry git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/rubygems/test_gem_commands_install_command.rb | 39 ++++++++++++---------- 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'test/rubygems/test_gem_commands_install_command.rb') diff --git a/test/rubygems/test_gem_commands_install_command.rb b/test/rubygems/test_gem_commands_install_command.rb index a3ceb81ab7..adc66aa911 100644 --- a/test/rubygems/test_gem_commands_install_command.rb +++ b/test/rubygems/test_gem_commands_install_command.rb @@ -7,6 +7,12 @@ require 'rubygems/test_case' require 'rubygems/commands/install_command' +begin + gem "rdoc" +rescue Gem::LoadError + # ignore +end + class TestGemCommandsInstallCommand < Gem::TestCase def setup @@ -22,9 +28,9 @@ class TestGemCommandsInstallCommand < Gem::TestCase util_setup_spec_fetcher @a2, @a2_pre @fetcher.data["#{@gem_repo}gems/#{@a2.file_name}"] = - read_binary(File.join(@gemhome, 'cache', @a2.file_name)) + read_binary(Gem.cache_gem(@a2.file_name, @gemhome)) @fetcher.data["#{@gem_repo}gems/#{@a2_pre.file_name}"] = - read_binary(File.join(@gemhome, 'cache', @a2_pre.file_name)) + read_binary(Gem.cache_gem(@a2_pre.file_name, @gemhome)) @cmd.options[:args] = [@a2.name] @@ -44,11 +50,12 @@ class TestGemCommandsInstallCommand < Gem::TestCase util_setup_spec_fetcher @a2, @a2_pre @fetcher.data["#{@gem_repo}gems/#{@a2.file_name}"] = - read_binary(File.join(@gemhome, 'cache', @a2.file_name)) + read_binary(Gem.cache_gem(@a2.file_name, @gemhome)) @fetcher.data["#{@gem_repo}gems/#{@a2_pre.file_name}"] = - read_binary(File.join(@gemhome, 'cache', @a2_pre.file_name)) + read_binary(Gem.cache_gem(@a2_pre.file_name, @gemhome)) - @cmd.handle_options [@a2_pre.name, '--version', @a2_pre.version.to_s] + @cmd.handle_options [@a2_pre.name, '--version', @a2_pre.version.to_s, + "--no-ri", "--no-rdoc"] assert @cmd.options[:prerelease] assert @cmd.options[:version].satisfied_by?(@a2_pre.version) @@ -85,8 +92,7 @@ class TestGemCommandsInstallCommand < Gem::TestCase util_setup_fake_fetcher @cmd.options[:domain] = :local - FileUtils.mv File.join(@gemhome, 'cache', @a2.file_name), - File.join(@tempdir) + FileUtils.mv Gem.cache_gem(@a2.file_name, @gemhome), @tempdir @cmd.options[:args] = [@a2.name] @@ -115,8 +121,7 @@ class TestGemCommandsInstallCommand < Gem::TestCase util_setup_fake_fetcher @cmd.options[:user_install] = false - FileUtils.mv File.join(@gemhome, 'cache', @a2.file_name), - File.join(@tempdir) + FileUtils.mv Gem.cache_gem(@a2.file_name, @gemhome), @tempdir @cmd.options[:args] = [@a2.name] @@ -183,7 +188,7 @@ class TestGemCommandsInstallCommand < Gem::TestCase correctly_spelled = "non_existent_with_hint" util_setup_fake_fetcher - util_setup_spec_fetcher quick_gem(correctly_spelled, '2') + util_setup_spec_fetcher quick_spec(correctly_spelled, '2') @cmd.options[:args] = [misspelled] @@ -207,9 +212,9 @@ ERROR: Possible alternatives: non_existent_with_hint util_setup_spec_fetcher @a2, @a2_pre @fetcher.data["#{@gem_repo}gems/#{@a2.file_name}"] = - read_binary(File.join(@gemhome, 'cache', @a2.file_name)) + read_binary(Gem.cache_gem(@a2.file_name, @gemhome)) @fetcher.data["#{@gem_repo}gems/#{@a2_pre.file_name}"] = - read_binary(File.join(@gemhome, 'cache', @a2_pre.file_name)) + read_binary(Gem.cache_gem(@a2_pre.file_name, @gemhome)) @cmd.options[:prerelease] = true @cmd.options[:args] = [@a2_pre.name] @@ -233,7 +238,7 @@ ERROR: Possible alternatives: non_existent_with_hint util_setup_spec_fetcher @a2 @fetcher.data["#{@gem_repo}gems/#{@a2.file_name}"] = - read_binary(File.join(@gemhome, 'cache', @a2.file_name)) + read_binary(Gem.cache_gem(@a2.file_name, @gemhome)) @cmd.options[:args] = [@a2.name] @@ -260,11 +265,9 @@ ERROR: Possible alternatives: non_existent_with_hint util_setup_fake_fetcher @cmd.options[:domain] = :local - FileUtils.mv File.join(@gemhome, 'cache', @a2.file_name), - File.join(@tempdir) + FileUtils.mv Gem.cache_gem(@a2.file_name, @gemhome), @tempdir - FileUtils.mv File.join(@gemhome, 'cache', @b2.file_name), - File.join(@tempdir) + FileUtils.mv Gem.cache_gem(@b2.file_name, @gemhome), @tempdir @cmd.options[:args] = [@a2.name, @b2.name] @@ -293,7 +296,7 @@ ERROR: Possible alternatives: non_existent_with_hint util_setup_spec_fetcher @b2 @fetcher.data["#{@gem_repo}gems/#{@b2.file_name}"] = - read_binary(File.join(@gemhome, 'cache', @b2.file_name)) + read_binary(Gem.cache_gem(@b2.file_name, @gemhome)) uninstall_gem(@b2) -- cgit v1.2.3