[rubygems/rubygems] Update gem request tests to pass a Gem::Uri into the Gem::Request class

https://github.com/rubygems/rubygems/commit/e8e7c2078f
This commit is contained in:
Jonathan 2021-09-17 12:40:53 -06:00 коммит произвёл Hiroshi SHIBATA
Родитель 63109976be
Коммит 42dcac00b1
1 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -185,7 +185,7 @@ class TestGemRequest < Gem::TestCase
end
def test_fetch
uri = URI.parse "#{@gem_repo}/specs.#{Gem.marshal_version}"
uri = Gem::Uri.new(URI.parse "#{@gem_repo}/specs.#{Gem.marshal_version}")
response = util_stub_net_http(:body => :junk, :code => 200) do
@request = make_request(uri, Net::HTTP::Get, nil, nil)
@ -198,7 +198,7 @@ class TestGemRequest < Gem::TestCase
def test_fetch_basic_auth
Gem.configuration.verbose = :really
uri = URI.parse "https://user:pass@example.rubygems/specs.#{Gem.marshal_version}"
uri = Gem::Uri.new(URI.parse "https://user:pass@example.rubygems/specs.#{Gem.marshal_version}")
conn = util_stub_net_http(:body => :junk, :code => 200) do |c|
use_ui @ui do
@request = make_request(uri, Net::HTTP::Get, nil, nil)
@ -214,7 +214,7 @@ class TestGemRequest < Gem::TestCase
def test_fetch_basic_auth_encoded
Gem.configuration.verbose = :really
uri = URI.parse "https://user:%7BDEScede%7Dpass@example.rubygems/specs.#{Gem.marshal_version}"
uri = Gem::Uri.new(URI.parse "https://user:%7BDEScede%7Dpass@example.rubygems/specs.#{Gem.marshal_version}")
conn = util_stub_net_http(:body => :junk, :code => 200) do |c|
use_ui @ui do
@ -231,7 +231,7 @@ class TestGemRequest < Gem::TestCase
def test_fetch_basic_oauth_encoded
Gem.configuration.verbose = :really
uri = URI.parse "https://%7BDEScede%7Dpass:x-oauth-basic@example.rubygems/specs.#{Gem.marshal_version}"
uri = Gem::Uri.new(URI.parse "https://%7BDEScede%7Dpass:x-oauth-basic@example.rubygems/specs.#{Gem.marshal_version}")
conn = util_stub_net_http(:body => :junk, :code => 200) do |c|
use_ui @ui do
@ -247,7 +247,7 @@ class TestGemRequest < Gem::TestCase
end
def test_fetch_head
uri = URI.parse "#{@gem_repo}/specs.#{Gem.marshal_version}"
uri = Gem::Uri.new(URI.parse "#{@gem_repo}/specs.#{Gem.marshal_version}")
response = util_stub_net_http(:body => '', :code => 200) do |conn|
@request = make_request(uri, Net::HTTP::Get, nil, nil)
@request.fetch
@ -258,7 +258,7 @@ class TestGemRequest < Gem::TestCase
end
def test_fetch_unmodified
uri = URI.parse "#{@gem_repo}/specs.#{Gem.marshal_version}"
uri = Gem::Uri.new(URI.parse "#{@gem_repo}/specs.#{Gem.marshal_version}")
t = Time.utc(2013, 1, 2, 3, 4, 5)
conn, response = util_stub_net_http(:body => '', :code => 304) do |c|
@request = make_request(uri, Net::HTTP::Get, t, nil)