mirror of
https://github.com/ruby/ruby.git
synced 2025-09-18 18:13:58 +02:00
merge revision(s) 39621,39622: [Backport #7991]
* lib/rubygems/commands/setup_command.rb: Install .pem files. * test/rubygems/test_gem_commands_setup_command.rb: Test for the above. * lib/rubygems/spec_fetcher.rb: Test HTTPS upgrade with URI::HTTPS, not URI::HTTP. Fixes bug in automatic HTTPS upgrade. * test/rubygems/test_gem_spec_fetcher.rb: Test for the above. * lib/rubygems.rb: Version 2.0.2 * lib/rubygems/test_utilities.rb: Ensure scheme and uri class match. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@39800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c071b47a22
commit
cae2f1eb8b
8 changed files with 92 additions and 8 deletions
|
@ -11,11 +11,17 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|||
@cmd.options[:prefix] = @install_dir
|
||||
|
||||
FileUtils.mkdir_p 'bin'
|
||||
FileUtils.mkdir_p 'lib/rubygems'
|
||||
FileUtils.mkdir_p 'lib/rubygems/ssl_certs'
|
||||
|
||||
open 'bin/gem', 'w' do |io| io.puts '# gem' end
|
||||
open 'lib/rubygems.rb', 'w' do |io| io.puts '# rubygems.rb' end
|
||||
open 'lib/rubygems/test_case.rb', 'w' do |io| io.puts '# test_case.rb' end
|
||||
open 'lib/rubygems/ssl_certs/foo.pem', 'w' do |io| io.puts 'PEM' end
|
||||
end
|
||||
|
||||
def test_pem_files_in
|
||||
assert_equal %w[rubygems/ssl_certs/foo.pem],
|
||||
@cmd.pem_files_in('lib').sort
|
||||
end
|
||||
|
||||
def test_rb_files_in
|
||||
|
@ -23,6 +29,17 @@ class TestGemCommandsSetupCommand < Gem::TestCase
|
|||
@cmd.rb_files_in('lib').sort
|
||||
end
|
||||
|
||||
def test_install_lib
|
||||
@cmd.extend FileUtils
|
||||
|
||||
Dir.mktmpdir 'lib' do |dir|
|
||||
@cmd.install_lib dir
|
||||
|
||||
assert_path_exists File.join(dir, 'rubygems.rb')
|
||||
assert_path_exists File.join(dir, 'rubygems/ssl_certs/foo.pem')
|
||||
end
|
||||
end
|
||||
|
||||
def test_remove_old_lib_files
|
||||
lib = File.join @install_dir, 'lib'
|
||||
lib_rubygems = File.join lib, 'rubygems'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue