show attempted url when setting invalid app_host or default_host

This commit is contained in:
Adam Steel 2018-01-17 14:23:14 -07:00
parent dfaf958ea7
commit 39e9b2f7fb
1 changed files with 2 additions and 2 deletions

View File

@ -68,13 +68,13 @@ module Capybara
remove_method :app_host=
def app_host=(url)
raise ArgumentError, "Capybara.app_host should be set to a url (http://www.example.com)" unless url.nil? || (url =~ URI::DEFAULT_PARSER.make_regexp)
raise ArgumentError, "Capybara.app_host should be set to a url (http://www.example.com). Tried to set to #{url.inspect}." unless url.nil? || (url =~ URI::DEFAULT_PARSER.make_regexp)
@app_host = url
end
remove_method :default_host=
def default_host=(url)
raise ArgumentError, "Capybara.default_host should be set to a url (http://www.example.com)" unless url.nil? || (url =~ URI::DEFAULT_PARSER.make_regexp)
raise ArgumentError, "Capybara.default_host should be set to a url (http://www.example.com). Tried to set to #{url.inspect}." unless url.nil? || (url =~ URI::DEFAULT_PARSER.make_regexp)
@default_host = url
end