From 39e9b2f7fba264699e793fe1d6935497de623f1b Mon Sep 17 00:00:00 2001 From: Adam Steel Date: Wed, 17 Jan 2018 14:23:14 -0700 Subject: [PATCH] show attempted url when setting invalid app_host or default_host --- lib/capybara/session/config.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/capybara/session/config.rb b/lib/capybara/session/config.rb index a1f62226..16dd31be 100644 --- a/lib/capybara/session/config.rb +++ b/lib/capybara/session/config.rb @@ -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