1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Import rubygems 1.6.0 (released version @ 58d8a0b9)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ryan 2011-03-01 09:41:32 +00:00
parent 86bb0af7ea
commit 25a9b62d45
73 changed files with 2408 additions and 719 deletions

View file

@ -15,7 +15,7 @@ class TestGemCommandsPristineCommand < Gem::TestCase
end
def test_execute
a = quick_gem 'a' do |s| s.executables = %w[foo] end
a = quick_spec 'a' do |s| s.executables = %w[foo] end
FileUtils.mkdir_p File.join(@tempdir, 'bin')
File.open File.join(@tempdir, 'bin', 'foo'), 'w' do |fp|
fp.puts "#!/usr/bin/ruby"
@ -45,7 +45,7 @@ class TestGemCommandsPristineCommand < Gem::TestCase
end
def test_execute_all
a = quick_gem 'a' do |s| s.executables = %w[foo] end
a = quick_spec 'a' do |s| s.executables = %w[foo] end
FileUtils.mkdir_p File.join(@tempdir, 'bin')
File.open File.join(@tempdir, 'bin', 'foo'), 'w' do |fp|
fp.puts "#!/usr/bin/ruby"
@ -73,15 +73,29 @@ class TestGemCommandsPristineCommand < Gem::TestCase
end
def test_execute_missing_cache_gem
a = quick_gem 'a' do |s| s.executables = %w[foo] end
a = quick_spec 'a' do |s|
s.executables = %w[foo]
end
FileUtils.mkdir_p File.join(@tempdir, 'bin')
File.open File.join(@tempdir, 'bin', 'foo'), 'w' do |fp|
fp.puts "#!/usr/bin/ruby"
end
install_gem a
FileUtils.rm File.join(@gemhome, 'cache', a.file_name)
a_data = nil
open File.join(@gemhome, 'cache', a.file_name), 'rb' do |fp|
a_data = fp.read
end
util_setup_fake_fetcher
util_setup_spec_fetcher a
Gem::RemoteFetcher.fetcher.data["http://gems.example.com/gems/#{a.file_name}"] = a_data
FileUtils.rm Gem.cache_gem(a.file_name, @gemhome)
@cmd.options[:args] = %w[a]
@ -91,11 +105,17 @@ class TestGemCommandsPristineCommand < Gem::TestCase
out = @ui.output.split "\n"
assert_equal "Restoring gem\(s\) to pristine condition...", out.shift
assert_empty out, out.inspect
[
"Restoring gem\(s\) to pristine condition...",
"Restored a-1",
"Cached gem for a-2 not found, attempting to fetch...",
"Restored a-2",
"Restored a-3.a"
].each do |line|
assert_equal line, out.shift
end
assert_equal "ERROR: Cached gem for #{a.full_name} not found, use `gem install` to restore\n",
@ui.error
assert_empty out, out.inspect
end
def test_execute_no_gem