diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-08 01:32:18 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-08 01:32:18 +0000 |
commit | c00e84327f14845bd484e76b5ee5dfeb1fa9ce3d (patch) | |
tree | 9f558dafa363f4f0118d504a50cd4461e2821cd1 /test/rubygems/test_gem_commands_install_command.rb | |
parent | 6b05153a3a75b74b64553d6a46f501d9ee0f0376 (diff) | |
download | ruby-c00e84327f14845bd484e76b5ee5dfeb1fa9ce3d.tar.gz |
Merge rubygems master.
This is RC version of Rubygems 2.7.0.
https://github.com/rubygems/rubygems/commit/688fb7e83c13c3fe7c2bb03c49a2db4c82852aee
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60133 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.rb | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/test/rubygems/test_gem_commands_install_command.rb b/test/rubygems/test_gem_commands_install_command.rb index 13b9a7bbad..dd86a85038 100644 --- a/test/rubygems/test_gem_commands_install_command.rb +++ b/test/rubygems/test_gem_commands_install_command.rb @@ -96,6 +96,39 @@ class TestGemCommandsInstallCommand < Gem::TestCase assert_match "1 gem installed", @ui.output end + def test_execute_local_transitive_prerelease + specs = spec_fetcher do |fetcher| + fetcher.download 'a', 2, 'b' => "2.a", 'c' => '3' + fetcher.download 'b', '2.a' + fetcher.download 'c', '3' + end + + @cmd.options[:domain] = :local + + FileUtils.mv specs['a-2'].cache_file, @tempdir + FileUtils.mv specs['b-2.a'].cache_file, @tempdir + FileUtils.mv specs['c-3'].cache_file, @tempdir + + @cmd.options[:args] = %w[a] + + use_ui @ui do + orig_dir = Dir.pwd + begin + Dir.chdir @tempdir + FileUtils.rm_r [@gemhome, "gems"] + assert_raises Gem::MockGemUi::SystemExitException, @ui.error do + @cmd.execute + end + ensure + Dir.chdir orig_dir + end + end + + assert_equal %w[a-2 b-2.a c-3], @cmd.installed_specs.map { |spec| spec.full_name }.sort + + assert_match "3 gems installed", @ui.output + end + def test_execute_no_user_install skip 'skipped on MS Windows (chmod has no effect)' if win_platform? @@ -588,7 +621,7 @@ ERROR: Possible alternatives: non_existent_with_hint done_installing = true end - spec = quick_spec 'a', 2 + spec = util_spec 'a', 2 util_build_gem spec @@ -616,7 +649,7 @@ ERROR: Possible alternatives: non_existent_with_hint end def test_install_gem_ignore_dependencies_specific_file - spec = quick_spec 'a', 2 + spec = util_spec 'a', 2 util_build_gem spec |