aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_commands_install_command.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-18 21:56:18 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-18 21:56:18 +0000
commit08aa6d59a2bc35556125d373f90f5286440c6f84 (patch)
tree532694033c6b495c4355b9f35a1a8b60497ad103 /test/rubygems/test_gem_commands_install_command.rb
parent9f9b47671052072a305275b99d7e132cf17fbc79 (diff)
downloadruby-08aa6d59a2bc35556125d373f90f5286440c6f84.tar.gz
* lib/rubygems: Update to RubyGems master 0a3814b. Changes:
Fixed extension directory in Gem::Specification#require_paths. Allow installation of gems when $HOME is nonexistent or unwritable. Use proper API in InstallCommand. Improve support for path option in gem dependency files. Remove warnings. * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_commands_install_command.rb')
-rw-r--r--test/rubygems/test_gem_commands_install_command.rb111
1 files changed, 36 insertions, 75 deletions
diff --git a/test/rubygems/test_gem_commands_install_command.rb b/test/rubygems/test_gem_commands_install_command.rb
index 24159e4c71..625d85e372 100644
--- a/test/rubygems/test_gem_commands_install_command.rb
+++ b/test/rubygems/test_gem_commands_install_command.rb
@@ -38,10 +38,9 @@ class TestGemCommandsInstallCommand < Gem::TestCase
@cmd.options[:args] = [@a2.name]
use_ui @ui do
- e = assert_raises Gem::SystemExitException do
+ assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
- assert_equal 0, e.exit_code, @ui.error
end
assert_equal %w[a-2], @cmd.installed_specs.map { |spec| spec.full_name }
@@ -62,10 +61,9 @@ class TestGemCommandsInstallCommand < Gem::TestCase
assert @cmd.options[:version].satisfied_by?(@a2_pre.version)
use_ui @ui do
- e = assert_raises Gem::SystemExitException do
+ assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
- assert_equal 0, e.exit_code, @ui.error
end
assert_equal %w[a-2.a], @cmd.installed_specs.map { |spec| spec.full_name }
@@ -83,10 +81,9 @@ class TestGemCommandsInstallCommand < Gem::TestCase
orig_dir = Dir.pwd
begin
Dir.chdir @tempdir
- e = assert_raises Gem::SystemExitException do
+ assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
- assert_equal 0, e.exit_code
ensure
Dir.chdir orig_dir
end
@@ -131,7 +128,7 @@ class TestGemCommandsInstallCommand < Gem::TestCase
@cmd.options[:args] = %w[no_such_gem]
use_ui @ui do
- e = assert_raises Gem::SystemExitException do
+ e = assert_raises Gem::MockGemUi::TermError do
@cmd.execute
end
assert_equal 2, e.exit_code
@@ -156,7 +153,7 @@ class TestGemCommandsInstallCommand < Gem::TestCase
@cmd.options[:args] = %w[nonexistent]
use_ui @ui do
- e = assert_raises Gem::SystemExitException do
+ e = assert_raises Gem::MockGemUi::TermError do
@cmd.execute
end
assert_equal 2, e.exit_code
@@ -184,7 +181,7 @@ class TestGemCommandsInstallCommand < Gem::TestCase
@cmd.options[:args] = %w[nonexistent]
use_ui @ui do
- e = assert_raises Gem::SystemExitException do
+ e = assert_raises Gem::MockGemUi::TermError do
@cmd.execute
end
assert_equal 2, e.exit_code
@@ -206,7 +203,7 @@ class TestGemCommandsInstallCommand < Gem::TestCase
@cmd.options[:args] = [misspelled]
use_ui @ui do
- e = assert_raises Gem::SystemExitException do
+ e = assert_raises Gem::MockGemUi::TermError do
@cmd.execute
end
@@ -230,7 +227,7 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = [misspelled]
use_ui @ui do
- e = assert_raises Gem::SystemExitException do
+ e = assert_raises Gem::MockGemUi::TermError do
@cmd.execute
end
@@ -273,10 +270,9 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = [@a2_pre.name]
use_ui @ui do
- e = assert_raises Gem::SystemExitException do
+ assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
- assert_equal 0, e.exit_code, @ui.error
end
assert_equal %w[a-1], @cmd.installed_specs.map { |spec| spec.full_name }
@@ -296,10 +292,9 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = [@a2_pre.name]
use_ui @ui do
- e = assert_raises Gem::SystemExitException do
+ assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
- assert_equal 0, e.exit_code, @ui.error
end
assert_equal %w[a-2.a], @cmd.installed_specs.map { |spec| spec.full_name }
@@ -319,10 +314,9 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = [@a2_pre.name]
use_ui @ui do
- e = assert_raises Gem::SystemExitException do
+ assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
- assert_equal 0, e.exit_code, @ui.error
end
assert_equal %w[a-2], @cmd.installed_specs.map { |spec| spec.full_name }
@@ -347,14 +341,12 @@ ERROR: Possible alternatives: non_existent_with_hint
begin
Dir.chdir @tempdir
- e = assert_raises Gem::SystemExitException do
+ assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
ensure
Dir.chdir old
end
-
- assert_equal 0, e.exit_code
end
wait_for_child_process_to_exit
@@ -383,14 +375,12 @@ ERROR: Possible alternatives: non_existent_with_hint
begin
Dir.chdir @tempdir
- e = assert_raises Gem::SystemExitException do
+ assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
ensure
Dir.chdir old
end
-
- assert_equal 0, e.exit_code
end
path = @a2.build_info_file
@@ -410,12 +400,9 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = [@a2.name]
use_ui @ui do
- e = assert_raises Gem::SystemExitException do
- capture_io do
- @cmd.execute
- end
+ assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ @cmd.execute
end
- assert_equal 0, e.exit_code
end
assert_equal %w[a-2], @cmd.installed_specs.map { |spec| spec.full_name }
@@ -448,10 +435,9 @@ ERROR: Possible alternatives: non_existent_with_hint
use_ui @ui do
Dir.chdir @tempdir do
- e = assert_raises Gem::SystemExitException do
+ assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
- assert_equal 0, e.exit_code
end
end
@@ -478,10 +464,9 @@ ERROR: Possible alternatives: non_existent_with_hint
orig_dir = Dir.pwd
begin
Dir.chdir @tempdir
- e = assert_raises Gem::SystemExitException do
+ assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
@cmd.execute
end
- assert_equal 0, e.exit_code
ensure
Dir.chdir orig_dir
end
@@ -529,7 +514,7 @@ ERROR: Possible alternatives: non_existent_with_hint
orig_dir = Dir.pwd
begin
Dir.chdir @tempdir
- assert_raises Gem::SystemExitException do
+ assert_raises Gem::MockGemUi::SystemExitException do
@cmd.execute
end
ensure
@@ -560,7 +545,7 @@ ERROR: Possible alternatives: non_existent_with_hint
orig_dir = Dir.pwd
begin
Dir.chdir @tempdir
- e = assert_raises Gem::SystemExitException do
+ e = assert_raises Gem::MockGemUi::TermError do
@cmd.execute
end
ensure
@@ -582,7 +567,7 @@ ERROR: Possible alternatives: non_existent_with_hint
orig_dir = Dir.pwd
begin
Dir.chdir @tempdir
- e = assert_raises Gem::SystemExitException do
+ e = assert_raises Gem::MockGemUi::TermError do
@cmd.execute
end
ensure
@@ -607,12 +592,9 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:args] = [@a2.name]
use_ui @ui do
- e = assert_raises Gem::SystemExitException do
- capture_io do
- @cmd.execute
- end
+ assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ @cmd.execute
end
- assert_equal 0, e.exit_code
end
assert_equal %w[a-2], @cmd.installed_specs.map { |spec| spec.full_name }
@@ -639,12 +621,9 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:gemdeps] = @gemdeps
use_ui @ui do
- e = assert_raises Gem::SystemExitException do
- capture_io do
- @cmd.execute
- end
+ assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ @cmd.execute
end
- assert_equal 0, e.exit_code
end
assert_equal %w[], @cmd.installed_specs.map { |spec| spec.full_name }
@@ -667,12 +646,9 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:gemdeps] = @gemdeps
use_ui @ui do
- e = assert_raises Gem::SystemExitException do
- capture_io do
- @cmd.execute
- end
+ assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ @cmd.execute
end
- assert_equal 0, e.exit_code
end
assert_equal %w[a-2], @cmd.installed_specs.map { |spec| spec.full_name }
@@ -698,12 +674,9 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:gemdeps] = @gemdeps
use_ui @ui do
- e = assert_raises Gem::SystemExitException do
- capture_io do
- @cmd.execute
- end
+ assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ @cmd.execute
end
- assert_equal 0, e.exit_code
end
names = @cmd.installed_specs.map { |spec| spec.full_name }
@@ -733,12 +706,9 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:gemdeps] = @gemdeps
use_ui @ui do
- e = assert_raises Gem::SystemExitException do
- capture_io do
- @cmd.execute
- end
+ assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ @cmd.execute
end
- assert_equal 0, e.exit_code
end
names = @cmd.installed_specs.map { |spec| spec.full_name }
@@ -768,12 +738,9 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:gemdeps] = @gemdeps
use_ui @ui do
- e = assert_raises Gem::SystemExitException do
- capture_io do
- @cmd.execute
- end
+ assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ @cmd.execute
end
- assert_equal 0, e.exit_code
end
names = @cmd.installed_specs.map { |spec| spec.full_name }
@@ -808,12 +775,9 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:gemdeps] = @gemdeps
use_ui @ui do
- e = assert_raises Gem::SystemExitException do
- capture_io do
- @cmd.execute
- end
+ assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ @cmd.execute
end
- assert_equal 0, e.exit_code
end
names = @cmd.installed_specs.map { |spec| spec.full_name }
@@ -850,12 +814,9 @@ ERROR: Possible alternatives: non_existent_with_hint
@cmd.options[:gemdeps] = @gemdeps
use_ui @ui do
- e = assert_raises Gem::SystemExitException do
- capture_io do
- @cmd.execute
- end
+ assert_raises Gem::MockGemUi::SystemExitException, @ui.error do
+ @cmd.execute
end
- assert_equal 0, e.exit_code
end
names = @cmd.installed_specs.map { |spec| spec.full_name }