1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

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

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