mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rubygems: update to 1.3.6.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
65544f575b
commit
b551e8c8b3
119 changed files with 2735 additions and 2613 deletions
|
@ -9,12 +9,13 @@ class TestGemCommandsDependencyCommand < RubyGemTestCase
|
|||
@cmd = Gem::Commands::DependencyCommand.new
|
||||
@cmd.options[:domain] = :local
|
||||
|
||||
util_setup_fake_fetcher
|
||||
util_setup_fake_fetcher true
|
||||
end
|
||||
|
||||
def test_execute
|
||||
quick_gem 'foo' do |gem|
|
||||
gem.add_dependency 'bar', '> 1'
|
||||
gem.add_dependency 'baz', '> 1'
|
||||
end
|
||||
|
||||
Gem.source_index = nil
|
||||
|
@ -25,7 +26,8 @@ class TestGemCommandsDependencyCommand < RubyGemTestCase
|
|||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_equal "Gem foo-2\n bar (> 1, runtime)\n\n", @ui.output
|
||||
assert_equal "Gem foo-2\n bar (> 1, runtime)\n baz (> 1, runtime)\n\n",
|
||||
@ui.output
|
||||
assert_equal '', @ui.error
|
||||
end
|
||||
|
||||
|
@ -41,6 +43,8 @@ class TestGemCommandsDependencyCommand < RubyGemTestCase
|
|||
expected = <<-EOF
|
||||
Gem a-1
|
||||
|
||||
Gem a-2.a
|
||||
|
||||
Gem a-2
|
||||
|
||||
Gem a-3.a
|
||||
|
@ -100,6 +104,8 @@ Gem pl-1-x86-linux
|
|||
expected = <<-EOF
|
||||
Gem a-1
|
||||
|
||||
Gem a-2.a
|
||||
|
||||
Gem a-2
|
||||
|
||||
Gem a-3.a
|
||||
|
@ -173,8 +179,7 @@ ERROR: Only reverse dependencies for local gems are supported.
|
|||
|
||||
util_setup_spec_fetcher foo
|
||||
|
||||
FileUtils.rm File.join(@gemhome, 'specifications',
|
||||
"#{foo.full_name}.gemspec")
|
||||
FileUtils.rm File.join(@gemhome, 'specifications', foo.spec_name)
|
||||
|
||||
@cmd.options[:args] = %w[foo]
|
||||
@cmd.options[:domain] = :remote
|
||||
|
@ -187,43 +192,24 @@ ERROR: Only reverse dependencies for local gems are supported.
|
|||
assert_equal '', @ui.error
|
||||
end
|
||||
|
||||
def test_execute_remote_legacy
|
||||
foo = quick_gem 'foo' do |gem|
|
||||
gem.add_dependency 'bar', '> 1'
|
||||
end
|
||||
|
||||
def test_execute_prerelease
|
||||
@fetcher = Gem::FakeFetcher.new
|
||||
Gem::RemoteFetcher.fetcher = @fetcher
|
||||
|
||||
Gem::SpecFetcher.fetcher = nil
|
||||
si = util_setup_source_info_cache foo
|
||||
util_setup_spec_fetcher @a2_pre
|
||||
|
||||
@fetcher.data["#{@gem_repo}yaml"] = YAML.dump si
|
||||
@fetcher.data["#{@gem_repo}Marshal.#{Gem.marshal_version}"] =
|
||||
si.dump
|
||||
FileUtils.rm File.join(@gemhome, 'specifications', @a2_pre.spec_name)
|
||||
|
||||
@fetcher.data.delete "#{@gem_repo}latest_specs.#{Gem.marshal_version}.gz"
|
||||
|
||||
FileUtils.rm File.join(@gemhome, 'specifications',
|
||||
"#{foo.full_name}.gemspec")
|
||||
|
||||
@cmd.options[:args] = %w[foo]
|
||||
@cmd.options[:args] = %w[a]
|
||||
@cmd.options[:domain] = :remote
|
||||
@cmd.options[:prerelease] = true
|
||||
|
||||
use_ui @ui do
|
||||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_equal "Gem foo-2\n bar (> 1, runtime)\n\n", @ui.output
|
||||
|
||||
expected = <<-EOF
|
||||
WARNING: RubyGems 1.2+ index not found for:
|
||||
\t#{@gem_repo}
|
||||
|
||||
RubyGems will revert to legacy indexes degrading performance.
|
||||
EOF
|
||||
|
||||
assert_equal expected, @ui.error
|
||||
assert_equal "Gem a-2.a\n\n", @ui.output
|
||||
assert_equal '', @ui.error
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue