mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rubygems: Update to RubyGems master b9213d7. Changes include:
Fixed tests on Windows (I hope) by forcing platform for platform-dependent tests. Fixed File.exists? warnings. Improved testing infrastructure. * test/rubygems: ditto. * test/rdoc/test_rdoc_rubygems_hook.rb: Switch to util_spec like RubyGems. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8f3934261a
commit
44d0a6dcd7
45 changed files with 1068 additions and 906 deletions
|
@ -9,7 +9,7 @@ class TestGemCommandsPristineCommand < Gem::TestCase
|
|||
end
|
||||
|
||||
def test_execute
|
||||
a = quick_spec 'a' do |s|
|
||||
a = util_spec 'a' do |s|
|
||||
s.executables = %w[foo]
|
||||
s.files = %w[bin/foo lib/a.rb]
|
||||
end
|
||||
|
@ -51,7 +51,7 @@ class TestGemCommandsPristineCommand < Gem::TestCase
|
|||
end
|
||||
|
||||
def test_execute_all
|
||||
a = quick_spec 'a' do |s| s.executables = %w[foo] end
|
||||
a = util_spec 'a' do |s| s.executables = %w[foo] end
|
||||
write_file File.join(@tempdir, 'bin', 'foo') do |fp|
|
||||
fp.puts "#!/usr/bin/ruby"
|
||||
end
|
||||
|
@ -81,7 +81,7 @@ class TestGemCommandsPristineCommand < Gem::TestCase
|
|||
end
|
||||
|
||||
def test_execute_env_shebang
|
||||
a = quick_spec 'a' do |s|
|
||||
a = util_spec 'a' do |s|
|
||||
s.executables = %w[foo]
|
||||
s.files = %w[bin/foo]
|
||||
end
|
||||
|
@ -111,7 +111,7 @@ class TestGemCommandsPristineCommand < Gem::TestCase
|
|||
end
|
||||
|
||||
def test_execute_extensions_explicit
|
||||
a = quick_spec 'a' do |s| s.extensions << 'ext/a/extconf.rb' end
|
||||
a = util_spec 'a' do |s| s.extensions << 'ext/a/extconf.rb' end
|
||||
|
||||
ext_path = File.join @tempdir, 'ext', 'a', 'extconf.rb'
|
||||
write_file ext_path do |io|
|
||||
|
@ -124,7 +124,7 @@ class TestGemCommandsPristineCommand < Gem::TestCase
|
|||
RUBY
|
||||
end
|
||||
|
||||
b = quick_spec 'b'
|
||||
b = util_spec 'b'
|
||||
|
||||
install_gem a
|
||||
install_gem b
|
||||
|
@ -147,7 +147,7 @@ class TestGemCommandsPristineCommand < Gem::TestCase
|
|||
end
|
||||
|
||||
def test_execute_no_extension
|
||||
a = quick_spec 'a' do |s| s.extensions << 'ext/a/extconf.rb' end
|
||||
a = util_spec 'a' do |s| s.extensions << 'ext/a/extconf.rb' end
|
||||
|
||||
ext_path = File.join @tempdir, 'ext', 'a', 'extconf.rb'
|
||||
write_file ext_path do |io|
|
||||
|
@ -172,7 +172,7 @@ class TestGemCommandsPristineCommand < Gem::TestCase
|
|||
end
|
||||
|
||||
def test_execute_with_extension_with_build_args
|
||||
a = quick_spec 'a' do |s| s.extensions << 'ext/a/extconf.rb' end
|
||||
a = util_spec 'a' do |s| s.extensions << 'ext/a/extconf.rb' end
|
||||
|
||||
ext_path = File.join @tempdir, 'ext', 'a', 'extconf.rb'
|
||||
write_file ext_path do |io|
|
||||
|
@ -205,8 +205,8 @@ class TestGemCommandsPristineCommand < Gem::TestCase
|
|||
end
|
||||
|
||||
def test_execute_many
|
||||
a = quick_spec 'a'
|
||||
b = quick_spec 'b'
|
||||
a = util_spec 'a'
|
||||
b = util_spec 'b'
|
||||
|
||||
install_gem a
|
||||
install_gem b
|
||||
|
@ -226,14 +226,14 @@ class TestGemCommandsPristineCommand < Gem::TestCase
|
|||
end
|
||||
|
||||
def test_execute_many_multi_repo
|
||||
a = quick_spec 'a'
|
||||
a = util_spec 'a'
|
||||
install_gem a
|
||||
|
||||
Gem.clear_paths
|
||||
gemhome2 = File.join @tempdir, 'gemhome2'
|
||||
Gem.paths = { "GEM_PATH" => [gemhome2, @gemhome], "GEM_HOME" => gemhome2 }
|
||||
|
||||
b = quick_spec 'b'
|
||||
b = util_spec 'b'
|
||||
install_gem b
|
||||
|
||||
@cmd.options[:args] = %w[a b]
|
||||
|
@ -256,24 +256,14 @@ class TestGemCommandsPristineCommand < Gem::TestCase
|
|||
end
|
||||
|
||||
def test_execute_missing_cache_gem
|
||||
a_2 = quick_spec 'a', 2
|
||||
a_3 = quick_spec 'a', 3
|
||||
|
||||
install_gem a_2
|
||||
install_gem a_3
|
||||
|
||||
a_2_data = nil
|
||||
open File.join(@gemhome, 'cache', a_2.file_name), 'rb' do |fp|
|
||||
a_2_data = fp.read
|
||||
specs = spec_fetcher do |fetcher|
|
||||
fetcher.gem 'a', 1
|
||||
fetcher.gem 'a', 2
|
||||
fetcher.gem 'a', 3
|
||||
fetcher.gem 'a', '3.a'
|
||||
end
|
||||
|
||||
util_setup_fake_fetcher
|
||||
util_setup_spec_fetcher a_2
|
||||
|
||||
url = "http://gems.example.com/gems/#{a_2.file_name}"
|
||||
Gem::RemoteFetcher.fetcher.data[url] = a_2_data
|
||||
|
||||
FileUtils.rm a_2.cache_file
|
||||
FileUtils.rm specs['a-2'].cache_file
|
||||
|
||||
@cmd.options[:args] = %w[a]
|
||||
|
||||
|
@ -310,7 +300,7 @@ class TestGemCommandsPristineCommand < Gem::TestCase
|
|||
end
|
||||
|
||||
def test_execute_only_executables
|
||||
a = quick_spec 'a' do |s|
|
||||
a = util_spec 'a' do |s|
|
||||
s.executables = %w[foo]
|
||||
s.files = %w[bin/foo lib/a.rb]
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue