Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

refs #38314, add port and protocol to server unavailable message

  • Loading branch information...
commit 9889b7e22c746a028d3c783f34b2bc10458a3022 1 parent ab45a20
Alexander Litvinovsky litvinovsky authored
2  features/normal.feature
View
@@ -34,8 +34,10 @@ Feature: RightHTTPConnection can connect to a web server
Given a URL that hangs all the time
When I request that URL using RightHTTPConnection
Then I should get an exception
+ And Exception message should have full url
Scenario: consistent open timeout
Given a URL whose server is listening but always down
When I request that URL using RightHTTPConnection
Then I should get an exception
+ And Exception message should have full url
2  features/proxy.feature
View
@@ -59,9 +59,11 @@ Feature: RightHTTPConnection can connect to a web server through a proxy
And a proxy
When I request that URL using RightHTTPConnection
Then I should get an exception
+ And Exception message should have full url
Scenario: consistent open timeout
Given a URL whose server is listening but always down
And a proxy
When I request that URL using RightHTTPConnection
Then I should get an exception
+ And Exception message should have full url
6 features/step_definitions/right_http_connection.rb
View
@@ -88,6 +88,12 @@ class RightHttpConnectionFailure < Exception
@exception.should_not be_nil
end
+Then /^Exception message should have full url$/ do
+ @exception.message.should =~ /#{@uri.scheme}/
+ @exception.message.should =~ /#{@uri.host}/
+ @exception.message.should =~ /#{@uri.port}/
+end
+
Then /^I should get told to authenticate correctly$/ do
@result.should be_kind_of(Net::HTTPProxyAuthenticationRequired)
@connection.should have_no_errors_in(@output.string)
2  lib/right_http_connection.rb
View
@@ -220,7 +220,7 @@ def error_reset
# Error message stuff...
def banana_message
- return "#{@server} temporarily unavailable: (#{error_message})"
+ return "#{@protocol}://#{@server}:#{@port} temporarily unavailable: (#{error_message})"
end
def err_header
Please sign in to comment.
Something went wrong with that request. Please try again.