summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_commands_push_command.rb
diff options
context:
space:
mode:
authorJenny Shen <jenny.shen@shopify.com>2022-09-16 11:37:55 -0400
committergit <svn-admin@ruby-lang.org>2022-09-29 17:56:35 +0900
commit17b783ad9e62070e8636800fe3aa9c5570a65bda (patch)
treeaf0c225b7a18bb9a0013922821a457a2f7ba884e /test/rubygems/test_gem_commands_push_command.rb
parent1cbf0fd86356ccbac5556ab0f63ea8a4b08fd24d (diff)
[rubygems/rubygems] Surface entire redirect uri in permanent redirections
https://github.com/rubygems/rubygems/commit/da7837630b
Diffstat (limited to 'test/rubygems/test_gem_commands_push_command.rb')
-rw-r--r--test/rubygems/test_gem_commands_push_command.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/test/rubygems/test_gem_commands_push_command.rb b/test/rubygems/test_gem_commands_push_command.rb
index c58d3f3692..770ba25681 100644
--- a/test/rubygems/test_gem_commands_push_command.rb
+++ b/test/rubygems/test_gem_commands_push_command.rb
@@ -327,19 +327,17 @@ class TestGemCommandsPushCommand < Gem::TestCase
def test_sending_gem_to_permanent_redirect_host
@host = "http://rubygems.example"
- @fetcher.data["#{@host}/api/v1/gems"] = ["", 308, "Permanent Redirect"]
+ redirected_uri = "https://rubygems.example/api/v1/gems"
+ @fetcher.data["#{@host}/api/v1/gems"] = HTTPResponseFactory.create(body: "", code: 308, msg: "Permanent Redirect", headers: { "Location" => redirected_uri })
assert_raise Gem::MockGemUi::TermError do
use_ui @ui do
@cmd.instance_variable_set :@host, @host
-
- Gem::Uri.stub("parse", URI.parse("https://rubygems.example/")) do
- @cmd.send_gem(@path)
- end
+ @cmd.send_gem(@path)
end
end
- response = "The request has redirected permanently to https://rubygems.example. Please check your defined push host."
+ response = "The request has redirected permanently to #{redirected_uri}. Please check your defined push host."
assert_match response, @ui.output
end