diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-13 19:58:57 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-13 19:58:57 +0000 |
commit | 1daa0b113d853bfa57b776cc569939b61ca14292 (patch) | |
tree | f8c4acb08a551820299dff2b13966d6ac38d31e4 /test/rubygems/test_gem_commands_install_command.rb | |
parent | 85995e88d49c442b5b113c2676456133e79f5c02 (diff) | |
download | ruby-1daa0b113d853bfa57b776cc569939b61ca14292.tar.gz |
* lib/rubygems: Update to RubyGems 2.1.3
Fixed installing platform gems
Restored concurrent requires
Fixed installing gems with extensions with --install-dir
Fixed `gem fetch -v` to install the latest version
Fixed installing gems with "./" in their files entries
* test/rubygems/test_gem_package.rb: Tests for the above.
* NEWS: Updated for RubyGems 2.1.3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42938 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 | 66 |
1 files changed, 64 insertions, 2 deletions
diff --git a/test/rubygems/test_gem_commands_install_command.rb b/test/rubygems/test_gem_commands_install_command.rb index caf52f147d..f86d2837ea 100644 --- a/test/rubygems/test_gem_commands_install_command.rb +++ b/test/rubygems/test_gem_commands_install_command.rb @@ -6,7 +6,6 @@ class TestGemCommandsInstallCommand < Gem::TestCase def setup super - common_installer_setup @cmd = Gem::Commands::InstallCommand.new @cmd.options[:document] = [] @@ -169,7 +168,8 @@ class TestGemCommandsInstallCommand < Gem::TestCase # This is needed because we need to exercise the cache path # within SpecFetcher - path = File.join Gem.spec_cache_dir, "not-there.nothing%80", "latest_specs.4.8" + path = File.join Gem.user_home, '.gem', 'specs', "not-there.nothing%80", + "latest_specs.4.8" FileUtils.mkdir_p File.dirname(path) @@ -633,6 +633,67 @@ ERROR: Possible alternatives: non_existent_with_hint assert_equal x, e end + def test_execute_installs_dependencies + r, r_gem = util_gem 'r', '1', 'q' => '= 1' + q, q_gem = util_gem 'q', '1' + + util_setup_fake_fetcher + util_setup_spec_fetcher r, q + + Gem::Specification.reset + + @fetcher.data["#{@gem_repo}gems/#{q.file_name}"] = read_binary(q_gem) + @fetcher.data["#{@gem_repo}gems/#{r.file_name}"] = read_binary(r_gem) + + @cmd.options[:args] = ["r"] + + e = nil + use_ui @ui do + e = assert_raises Gem::SystemExitException do + capture_io do + @cmd.execute + end + end + end + + out = @ui.output.split "\n" + assert_equal "2 gems installed", out.shift + assert out.empty?, out.inspect + + assert_equal %w[q-1 r-1], @cmd.installed_specs.map { |spec| spec.full_name } + + assert_equal 0, e.exit_code + end + + def test_execute_satisfy_deps_of_local_from_sources + r, r_gem = util_gem 'r', '1', 'q' => '= 1' + q, q_gem = util_gem 'q', '1' + + util_setup_fake_fetcher + util_setup_spec_fetcher r, q + + Gem::Specification.reset + + @fetcher.data["#{@gem_repo}gems/#{q.file_name}"] = read_binary(q_gem) + + @cmd.options[:args] = [r_gem] + + use_ui @ui do + e = assert_raises Gem::SystemExitException do + capture_io do + @cmd.execute + end + end + assert_equal 0, e.exit_code + end + + assert_equal %w[q-1 r-1], @cmd.installed_specs.map { |spec| spec.full_name } + + out = @ui.output.split "\n" + assert_equal "2 gems installed", out.shift + assert out.empty?, out.inspect + end + def test_execute_uses_from_a_gemdeps util_setup_fake_fetcher util_setup_spec_fetcher @@ -890,3 +951,4 @@ ERROR: Possible alternatives: non_existent_with_hint end + |