diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-09 23:21:36 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-07-09 23:21:36 +0000 |
commit | 47f0248b0858898dd24d1e654cedf174059ca677 (patch) | |
tree | 493e84160f8609db408d88349f0624a3ff92c3c2 /test/rubygems/test_gem_commands_install_command.rb | |
parent | cd9f9e471977447a991ced4ea38efb2309459ef5 (diff) | |
download | ruby-47f0248b0858898dd24d1e654cedf174059ca677.tar.gz |
* lib/rubygems: Import RubyGems 2.1
* test/rubygems: Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41873 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, 2 insertions, 64 deletions
diff --git a/test/rubygems/test_gem_commands_install_command.rb b/test/rubygems/test_gem_commands_install_command.rb index 28b4e474ba..8bfb633070 100644 --- a/test/rubygems/test_gem_commands_install_command.rb +++ b/test/rubygems/test_gem_commands_install_command.rb @@ -5,6 +5,7 @@ class TestGemCommandsInstallCommand < Gem::TestCase def setup super + common_installer_setup @cmd = Gem::Commands::InstallCommand.new @cmd.options[:document] = [] @@ -167,8 +168,7 @@ class TestGemCommandsInstallCommand < Gem::TestCase # This is needed because we need to exercise the cache path # within SpecFetcher - path = File.join Gem.user_home, '.gem', 'specs', "not-there.nothing%80", - "latest_specs.4.8" + path = File.join Gem.spec_cache_dir, "not-there.nothing%80", "latest_specs.4.8" FileUtils.mkdir_p File.dirname(path) @@ -632,67 +632,6 @@ 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 @@ -950,4 +889,3 @@ ERROR: Possible alternatives: non_existent_with_hint end - |