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
|
@ -115,48 +115,9 @@ beta-gems.example.com is not a URI
|
|||
assert_equal '', @ui.error
|
||||
end
|
||||
|
||||
def test_execute_add_legacy
|
||||
util_setup_fake_fetcher
|
||||
util_setup_source_info_cache
|
||||
|
||||
si = Gem::SourceIndex.new
|
||||
si.add_spec @a1
|
||||
|
||||
@fetcher.data["#{@new_repo}/yaml"] = ''
|
||||
|
||||
@cmd.handle_options %W[--add #{@new_repo}]
|
||||
|
||||
use_ui @ui do
|
||||
@cmd.execute
|
||||
end
|
||||
|
||||
assert_equal [@gem_repo], Gem.sources
|
||||
|
||||
expected = <<-EOF
|
||||
WARNING: RubyGems 1.2+ index not found for:
|
||||
\t#{@new_repo}
|
||||
|
||||
Will cause RubyGems to revert to legacy indexes, degrading performance.
|
||||
EOF
|
||||
|
||||
assert_equal "#{@new_repo} added to sources\n", @ui.output
|
||||
assert_equal expected, @ui.error
|
||||
end
|
||||
|
||||
def test_execute_clear_all
|
||||
@cmd.handle_options %w[--clear-all]
|
||||
|
||||
util_setup_source_info_cache
|
||||
|
||||
cache = Gem::SourceInfoCache.cache
|
||||
cache.update
|
||||
cache.write_cache
|
||||
|
||||
assert File.exist?(cache.system_cache_file),
|
||||
'system cache file'
|
||||
assert File.exist?(cache.latest_system_cache_file),
|
||||
'latest system cache file'
|
||||
|
||||
util_setup_spec_fetcher
|
||||
|
||||
fetcher = Gem::SpecFetcher.fetcher
|
||||
|
@ -179,11 +140,6 @@ Will cause RubyGems to revert to legacy indexes, degrading performance.
|
|||
assert_equal expected, @ui.output
|
||||
assert_equal '', @ui.error
|
||||
|
||||
refute File.exist?(cache.system_cache_file),
|
||||
'system cache file'
|
||||
refute File.exist?(cache.latest_system_cache_file),
|
||||
'latest system cache file'
|
||||
|
||||
refute File.exist?(fetcher.dir), 'cache dir removed'
|
||||
end
|
||||
|
||||
|
@ -249,30 +205,5 @@ Will cause RubyGems to revert to legacy indexes, degrading performance.
|
|||
assert_equal '', @ui.error
|
||||
end
|
||||
|
||||
def test_execute_update_legacy
|
||||
@cmd.handle_options %w[--update]
|
||||
|
||||
util_setup_fake_fetcher
|
||||
util_setup_source_info_cache
|
||||
Gem::SourceInfoCache.reset
|
||||
|
||||
si = Gem::SourceIndex.new
|
||||
si.add_spec @a1
|
||||
@fetcher.data["#{@gem_repo}yaml"] = YAML.dump si
|
||||
@fetcher.data["#{@gem_repo}Marshal.#{@marshal_version}"] = si.dump
|
||||
|
||||
use_ui @ui do
|
||||
@cmd.execute
|
||||
end
|
||||
|
||||
expected = <<-EOF
|
||||
Bulk updating Gem source index for: #{@gem_repo}
|
||||
source cache successfully updated
|
||||
EOF
|
||||
|
||||
assert_equal expected, @ui.output
|
||||
assert_equal '', @ui.error
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue